aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS5
-rw-r--r--debian/changelog6
-rwxr-xr-xsystemctl11
3 files changed, 21 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index a302330..4273398 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,8 @@
+systemctl-service-shim 0.0.5
+============================
+2023-02-11
+* Add symlink control logic for /usr/bin also (for usrmerged systems)
+
systemctl-service-shim 0.0.4
============================
2022-07-14
diff --git a/debian/changelog b/debian/changelog
index 17e25c8..db21749 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+systemctl-service-shim (0.0.5-1) unstable; urgency=low
+
+ * Add usrmerge /usr/bin/systemctl control logic
+
+ -- B. Stack <bgstack15@gmail.com> Sat, 11 Feb 2023 22:22:20 -0500
+
systemctl-service-shim (0.0.4-1) unstable; urgency=low
* Add action 'preset'
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