diff options
author | B. Stack <bgstack15@gmail.com> | 2021-10-20 09:24:53 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2021-10-20 09:33:10 -0400 |
commit | abd012174f9545f4d4bd236716e51dedcad8c6f1 (patch) | |
tree | d0b1b735079111457f445166c11217c7822def1b /systemctl | |
parent | initial commit (diff) | |
download | systemctl-service-shim-upstream/0.0.2.tar.gz systemctl-service-shim-upstream/0.0.2.tar.bz2 systemctl-service-shim-upstream/0.0.2.zip |
add symlink control logicHEADupstream/0.0.2devuan/0.0.2master
Diffstat (limited to 'systemctl')
-rwxr-xr-x | systemctl | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -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 : |