Closed oliwer closed 4 years ago
Maybe we can launch it only if sbulb is launched by systemd ? (using https://serverfault.com/a/927481)
Currently the input/output/error pipes of systemd-notify --ready
is connect to sbulb process. Do we really want this ? If not we could use DEVNULL
.
Should we check if file systemd-notify
exists before to run with somethink like shutil.which
?
$INVOCATION_ID
.systemd-notify
.
- that is useless. If the binary is not present, it will just fail silently.
The only reason I could see would be that we keep stderr
connected and we launch systemd-notify
only if "systemd is used" AND "systemd-notify
is present&executable". So this way we see an output error only if systemd-notify
failed unexpectedly :thinking:
I'm going to use the environment variable $NOTIFY_SOCKET
instead of $INVOCATION_ID
. This variable is only set if the service has Type=notify
.
If this variable is set, systemd-notify
has to be present. If not, I want to see the shell error.
I am using suprocess.call() to be backward-compatible with python 2.