Skip to content

Commit 987de8f

Browse files
committed
fix under_systemd function on debian
Read command name in /proc
1 parent e402e8f commit 987de8f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

init/functions

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ qsvc() {
2323
}
2424

2525
under_systemd() {
26-
pidof systemd >/dev/null 2>&1
26+
local init_command_name
27+
read -r init_command_name < /proc/1/comm
28+
[ "$init_command_name" = "systemd" ]
2729
}
2830

2931
systemd_version_changed() {

0 commit comments

Comments
 (0)