Skip to content

Commit

Permalink
Silence systemctl messages
Browse files Browse the repository at this point in the history
systemctl status can be noisy if the log has been rotated, showing this
message:

> Warning: The unit file, source configuration file or drop-ins of
> podman.socket changed on disk. Run 'systemctl --user daemon-reload'
> to reload units.

This can be especially problematic in --quiet mode. This patch fixes
that by redirecting stderr of the systemctl call used to get the running
state of podman to /dev/null.
  • Loading branch information
ntrrgc committed Nov 13, 2024
1 parent 3bb7d24 commit 8385d91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utilities/podman.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ is_podman_user_socket_available() {
[ -S "${podman_socket}" ] || return 1

# ... and it should be controlled by the systemd user session.
systemctl status --user podman.socket >/dev/null
systemctl status --user podman.socket &>/dev/null
return ${?}
}

0 comments on commit 8385d91

Please sign in to comment.