xbps-triggers: systemd-service: use --root option.
This commit is contained in:
parent
e59c9741f1
commit
14648e5507
|
@ -58,13 +58,13 @@ run)
|
|||
# package is being removed.
|
||||
# stop and disable the unit.
|
||||
echo "Stopping systemd service ${_srv}..."
|
||||
systemctl stop ${_srv} >/dev/null 2>&1 || :
|
||||
systemctl --root=. stop ${_srv} >/dev/null 2>&1 || :
|
||||
echo "Disabling systemd service ${_srv}..."
|
||||
systemctl --no-reload disable ${_srv} >/dev/null 2>&1 || :
|
||||
systemctl --root=. --no-reload disable ${_srv} >/dev/null 2>&1 || :
|
||||
else
|
||||
# Package update, just disable the unit.
|
||||
echo "Disabling systemd service ${_srv}..."
|
||||
systemctl --no-reload disable ${_srv} >/dev/null 2>&1 || :
|
||||
systemctl --root=. --no-reload disable ${_srv} >/dev/null 2>&1 || :
|
||||
|
||||
fi
|
||||
else
|
||||
|
@ -72,10 +72,10 @@ run)
|
|||
# package is being installed.
|
||||
# enable (but don't start) the unit by default.
|
||||
echo "Enabling systemd service ${_srv}..."
|
||||
systemctl enable ${_srv} >/dev/null 2>&1 || :
|
||||
systemctl --root=. enable ${_srv} >/dev/null 2>&1 || :
|
||||
if [ -n "$systemd_booted" ]; then
|
||||
# reload systemd if running.
|
||||
systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
systemctl --root=. daemon-reload >/dev/null 2>&1 || :
|
||||
fi
|
||||
cat <<_EOF
|
||||
==========================================================================
|
||||
|
@ -96,16 +96,16 @@ Refer to the systemd documentation if more information is required.
|
|||
_EOF
|
||||
else
|
||||
# Enable the unit in case it wasn't added.
|
||||
systemctl enable ${_srv} >/dev/null 2>&1 || :
|
||||
systemctl --root=. enable ${_srv} >/dev/null 2>&1 || :
|
||||
|
||||
# package is being updated.
|
||||
if [ -n "$system_booted" ]; then
|
||||
# reload systemd if running.
|
||||
systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
systemctl --root=. daemon-reload >/dev/null 2>&1 || :
|
||||
fi
|
||||
if [ -n "$restart" ]; then
|
||||
# try restarting package service.
|
||||
systemctl try-restart ${_srv} >/dev/null 2>&1 || :
|
||||
systemctl --root=. try-restart ${_srv} >/dev/null 2>&1 || :
|
||||
else
|
||||
echo "systemd ${_srv} service must be restarted manually!"
|
||||
fi
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Template file for 'xbps-triggers'
|
||||
pkgname=xbps-triggers
|
||||
version=0.59
|
||||
version=0.60
|
||||
revision=1
|
||||
short_desc="The XBPS triggers for Void Linux"
|
||||
maintainer="Juan RP <xtraeme@gmail.com>"
|
||||
|
|
Loading…
Reference in New Issue