Commit 22f4812
committed
fix: improve systemd detection to check if systemd is actually running
The previous implementation checked if systemctl command exists, but this
fails in container environments where systemctl is installed but systemd
is not running as PID 1. This caused the script to try using systemctl
commands which would fail with 'System has not been booted with systemd'.
Now we check for /run/systemd/system directory which only exists when
systemd is actually running as the init system.
Signed-off-by: Gajesh Bhat <gajeshbht@gmail.com>1 parent 104ffc0 commit 22f4812
1 file changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
304 | 308 | | |
305 | 309 | | |
306 | 310 | | |
| |||
0 commit comments