Some distributions have clever dependency generators when building packages
and generate dependencies for each executable called out in shell scripts.
The end result is that a package built out of samba would contain explicit dependency
to systemd even though it is usable without systemd.
Making systemctl reference indirect avoids explicit dependency.
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Fri Feb 22 18:18:20 CET 2013 on sn-devel-104
#!/bin/sh
-
-winbind_is_active=$(/bin/systemctl is-active winbind.service)
+SYSTEMCTL=/bin/systemctl
+winbind_is_active=$($SYSTEMCTL is-active winbind.service)
test "${winbind_is_active}" = "active" || exit 0
winbind_offline_logon=$(testparm -s --parameter-name "winbind offline logon" 2>/dev/null)
case "$2" in
up|vpn-up)
- nmb_is_active=$(/bin/systemctl is-active nmb.service)
+ nmb_is_active=$($SYSTEMCTL is-active nmb.service)
if test "${nmb_is_active}" = "active"; then
- /bin/systemctl try-restart nmb.service || :
+ $SYSTEMCTL try-restart nmb.service || :
fi
/usr/bin/smbcontrol winbind online || :
;;