mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-11-23 01:53:47 +08:00
e2scrub: test for the presence of systemd using test -e /run/systemd/system
Debian has a package called "systemctl" which provides a systemctl executable to "manage services without systemd". So test for whether we have a fully functional systemd system by checking for the existence of /run/systemd/system instead testing for the presence of the command named systemctl. Addresses-Debian-Bug: #1070107 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
parent
3ab99d9b60
commit
7480dcacb0
@ -161,7 +161,7 @@ mapfile -t targets < <(ls_targets)
|
||||
for tgt in "${targets[@]}"; do
|
||||
# If we're not reaping and systemd is present, try invoking the
|
||||
# systemd service.
|
||||
if [ "${reap}" -ne 1 ] && type systemctl > /dev/null 2>&1; then
|
||||
if [ "${reap}" -ne 1 ] && [ -e /run/systemd/system ]; then
|
||||
svcname="$(escape_path_for_systemd "${tgt}")"
|
||||
${DBG} systemctl start "${svcname}" 2> /dev/null
|
||||
res=$?
|
||||
|
Loading…
Reference in New Issue
Block a user