aboutsummaryrefslogtreecommitdiff
path: root/systemctl
diff options
context:
space:
mode:
Diffstat (limited to 'systemctl')
-rwxr-xr-xsystemctl15
1 files changed, 14 insertions, 1 deletions
diff --git a/systemctl b/systemctl
index a4d8d54..23e799c 100755
--- a/systemctl
+++ b/systemctl
@@ -12,6 +12,7 @@
# History:
# 2020-05-14 place framework.sh contents inline so as not to depend on it.
# 2021-01-10 adapted for inclusion in devuan-sanity
+# 2021-10-20 add /bin/systemctl symlink control logic
# Usage:
# Should be mostly like systemctl from systemd.
# Reference: ftemplate.sh 2019-05-02a ; framework.sh 2018-05-02a
@@ -27,7 +28,7 @@
# in some service scripts that look for /bin/systemctl
# vim: set sw=3 sts=3 ts=3 et:
fiversion="2019-05-02a"
-systemctlversion="2021-06-11a"
+systemctlversion="2021-10-20a"
usage() {
${PAGER:-/usr/bin/less -F} >&2 <<ENDUSAGE
@@ -512,6 +513,13 @@ case "${action}" in
;;
esac
+if test "${0}" = "/bin/systemctl" && test "$( readlink -f /bin/systemctl )" = "/usr/sbin/systemctl" ;
+then
+ log_to_file "META: removing /bin/systemctl symlink"
+ unlink /bin/systemctl
+ export FIX_BIN_SYSTEMCTL=1
+fi
+
# list of actions
if test -n "${actionlist}" ;
then
@@ -524,5 +532,10 @@ then
done
fi
+if test "${FIX_BIN_SYSTEMCTL}" = "1" ;
+then
+ log_to_file "META: restoring /bin/systemctl symlink"
+ ln -s /usr/sbin/systemctl /bin/systemctl
+fi
# exit cleanly
:
bgstack15