aboutsummaryrefslogtreecommitdiff
path: root/systemctl
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2021-10-20 09:24:53 -0400
committerB. Stack <bgstack15@gmail.com>2021-10-20 09:33:10 -0400
commitabd012174f9545f4d4bd236716e51dedcad8c6f1 (patch)
treed0b1b735079111457f445166c11217c7822def1b /systemctl
parentinitial commit (diff)
downloadsystemctl-service-shim-master.tar.gz
systemctl-service-shim-master.tar.bz2
systemctl-service-shim-master.zip
add symlink control logicHEADupstream/0.0.2devuan/0.0.2master
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