aboutsummaryrefslogtreecommitdiff
path: root/systemctl
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2023-02-11 22:23:52 -0500
committerB. Stack <bgstack15@gmail.com>2023-02-11 22:23:52 -0500
commitdd91c7ccdf9b1c0d8f6a2c31a2aebb61890d3605 (patch)
tree005832aba41bae9f5244e9504a11815098b62236 /systemctl
parentv0.0.4 add action preset (diff)
downloadsystemctl-service-shim-dd91c7ccdf9b1c0d8f6a2c31a2aebb61890d3605.tar.gz
systemctl-service-shim-dd91c7ccdf9b1c0d8f6a2c31a2aebb61890d3605.tar.bz2
systemctl-service-shim-dd91c7ccdf9b1c0d8f6a2c31a2aebb61890d3605.zip
add /usr/bin/systemctl control logicupstream/0.0.5devuan/0.0.5
Diffstat (limited to 'systemctl')
-rwxr-xr-xsystemctl11
1 files changed, 10 insertions, 1 deletions
diff --git a/systemctl b/systemctl
index 78110a9..93bdcd6 100755
--- a/systemctl
+++ b/systemctl
@@ -15,6 +15,7 @@
# 2021-10-20 add /bin/systemctl symlink control logic
# 2022-07-12 Convert try-restart to restart
# 2022-07-14 Add preset, which runs update-rc.d ${service} defaults
+# 2023-02-11 Add /usr/bin/systemctl symlink control
# Usage:
# Should be mostly like systemctl from systemd.
# Reference: ftemplate.sh 2019-05-02a ; framework.sh 2018-05-02a
@@ -29,7 +30,7 @@
# in some service scripts that look for /bin/systemctl
# vim: set sw=3 sts=3 ts=3 et:
fiversion="2019-05-02a"
-systemctlversion="2022-07-14a"
+systemctlversion="2023-02-11a"
usage() {
${PAGER:-/usr/bin/less -F} >&2 <<ENDUSAGE
@@ -533,6 +534,13 @@ then
export FIX_BIN_SYSTEMCTL=1
fi
+if test "${0}" = "/usr/bin/systemctl" && test "$( readlink -f /usr/bin/systemctl )" = "/usr/sbin/systemctl" ;
+then
+ log_to_file "META: removing /usr/bin/systemctl symlink"
+ unlink /usr/bin/systemctl
+ export FIX_BIN_SYSTEMCTL=1
+fi
+
# list of actions
if test -n "${actionlist}" ;
then
@@ -549,6 +557,7 @@ if test "${FIX_BIN_SYSTEMCTL}" = "1" ;
then
log_to_file "META: restoring /bin/systemctl symlink"
ln -s /usr/sbin/systemctl /bin/systemctl
+ ln -s /usr/sbin/systemctl /usr/bin/systemctl 2>/dev/null # might fail if /usr/bin is symlink to /bin
fi
# exit cleanly
:
bgstack15