service: use systemd if running, fallback to sysv5 if not
This commit is contained in:
parent
6bd9de13f4
commit
41b99cdb29
@ -35,7 +35,9 @@ while [ $# -gt 0 ]; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -x "${INITDDIR}/${SERVICE}" ]; then
|
if [ -d /run/systemd ]; then
|
||||||
|
systemctl ${OPTIONS} ${SERVICE}.service
|
||||||
|
elif [ -x "${INITDDIR}/${SERVICE}" ]; then
|
||||||
env -i PATH="$PATH" TERM="$TERM" "${INITDDIR}/${SERVICE}" ${OPTIONS}
|
env -i PATH="$PATH" TERM="$TERM" "${INITDDIR}/${SERVICE}" ${OPTIONS}
|
||||||
else
|
else
|
||||||
echo "${SERVICE}: "$"unrecognized service" >&2
|
echo "${SERVICE}: "$"unrecognized service" >&2
|
||||||
|
Loading…
Reference in New Issue
Block a user