summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDidier Raboud <odyx@debian.org>2016-08-30 14:24:05 +0200
committerDidier Raboud <odyx@debian.org>2018-02-23 20:56:18 +0100
commitae0994c2199313d82fa06d2f6c08d509704f54da (patch)
tree7bba4f53dbd283a1b42b5210633a35f27d8ec994
parent52c1d22fb0d06c5396c832ecd20ad6d175cacdeb (diff)
Detect if systemd is running, not only if its corresponding configfiles is installed
Also change the systemctl path to fit Debian's Origin: vendor Bug-Debian: https://bugs.debian.org/725394 Gbp-Pq: Name 0003-Detect-if-systemd-is-running-not-only-if-its-corresp.patch
-rwxr-xr-xusb_modeswitch.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/usb_modeswitch.sh b/usb_modeswitch.sh
index eb3fa3e..f5f2f70 100755
--- a/usb_modeswitch.sh
+++ b/usb_modeswitch.sh
@@ -63,7 +63,7 @@ fi
PATH=/bin:/sbin:/usr/bin:/usr/sbin
init_path=`readlink -f /sbin/init`
-if [ `basename $init_path` = "systemd" ]; then
+if [ `basename $init_path` = "systemd" ] && [ -d "/run/systemd/system/" ]; then # Test if systemd is running
systemctl --no-block start usb_modeswitch@$p2.service
elif [ -e "/etc/init/usb-modeswitch-upstart.conf" ]; then
initctl emit --no-wait usb-modeswitch-upstart UMS_PARAM=$p2