Make systemctl reference indirect in packaging/NetworkManager/30-winbind-systemd
authorAlexander Bokovoy <ab@samba.org>
Fri, 22 Feb 2013 10:07:19 +0000 (12:07 +0200)
committerAlexander Bokovoy <ab@samba.org>
Fri, 22 Feb 2013 17:18:20 +0000 (18:18 +0100)
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

packaging/NetworkManager/30-winbind-systemd

index af0edf97471d45194073e99cbc9c7a24014c7e5f..9db422afea0241748799954d71d76fa8644e457c 100755 (executable)
@@ -1,6 +1,6 @@
 #!/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)
@@ -8,9 +8,9 @@ test "${winbind_offline_logon}" = "Yes" || exit 0
 
 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 || :
        ;;