xbps-triggers: update to 0.38 -- improved systemd-service trigger.
- Always run 'systemd-tmpfiles --create' at post INSTALL time. - Informative messages showing what's enabled/stopped, etc.
This commit is contained in:
parent
3595981d20
commit
b503a45593
|
@ -31,7 +31,8 @@ run)
|
||||||
[ ! -x bin/systemctl ] && exit 0
|
[ ! -x bin/systemctl ] && exit 0
|
||||||
[ -z "${systemd_services}" ] && exit 1
|
[ -z "${systemd_services}" ] && exit 1
|
||||||
|
|
||||||
if [ -e sys/fs/cgroups/systemd ]; then
|
systemd-notify --booted
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
systemd_booted=yes
|
systemd_booted=yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -50,21 +51,41 @@ run)
|
||||||
if [ "$UPDATE" = "no" ]; then
|
if [ "$UPDATE" = "no" ]; then
|
||||||
# package is being removed.
|
# package is being removed.
|
||||||
# disable and stop the unit.
|
# disable and stop the unit.
|
||||||
|
echo "Disabling systemd service ${_srv}..."
|
||||||
systemctl --no-reload disable ${_srv} >/dev/null 2>&1 || :
|
systemctl --no-reload disable ${_srv} >/dev/null 2>&1 || :
|
||||||
|
echo "Stopping systemd service ${_srv}..."
|
||||||
systemctl stop ${_srv} >/dev/null 2>&1 || :
|
systemctl stop ${_srv} >/dev/null 2>&1 || :
|
||||||
fi
|
fi
|
||||||
elif [ "$TARGET" = "post-install" ]; then
|
elif [ "$TARGET" = "post-install" ]; then
|
||||||
if [ "$UPDATE" = "no" ]; then
|
if [ "$UPDATE" = "no" ]; then
|
||||||
# package is being installed.
|
# package is being installed.
|
||||||
# enable (but don't start) the unit by default.
|
# enable (but don't start) the unit by default.
|
||||||
|
echo "Enabling systemd service ${_srv}..."
|
||||||
systemctl enable ${_srv} >/dev/null 2>&1 || :
|
systemctl enable ${_srv} >/dev/null 2>&1 || :
|
||||||
if [ "$systemd_booted" ]; then
|
if [ -n "$systemd_booted" ]; then
|
||||||
# reload systemd if running.
|
# reload systemd if running.
|
||||||
systemctl daemon-reload >/dev/null 2>&1 || :
|
systemctl daemon-reload >/dev/null 2>&1 || :
|
||||||
fi
|
fi
|
||||||
|
cat <<_EOF
|
||||||
|
==========================================================================
|
||||||
|
|
||||||
|
The service "${_srv}" has been enabled by default,
|
||||||
|
that means that it will be started in next boot. To start it immediately,
|
||||||
|
execute the following command (as root):
|
||||||
|
|
||||||
|
$ systemctl start ${_srv}
|
||||||
|
|
||||||
|
And to stop it:
|
||||||
|
|
||||||
|
$ systemctl stop ${_srv}
|
||||||
|
|
||||||
|
Refer to the systemd documentation if more information is required.
|
||||||
|
|
||||||
|
==========================================================================
|
||||||
|
_EOF
|
||||||
else
|
else
|
||||||
# package is being updated.
|
# package is being updated.
|
||||||
if [ "$system_booted" ]; then
|
if [ -n "$system_booted" ]; then
|
||||||
# reload systemd if running.
|
# reload systemd if running.
|
||||||
systemctl daemon-reload >/dev/null 2>&1 || :
|
systemctl daemon-reload >/dev/null 2>&1 || :
|
||||||
fi
|
fi
|
||||||
|
@ -75,6 +96,9 @@ run)
|
||||||
echo "systemd ${_srv} service must be restarted manually!"
|
echo "systemd ${_srv} service must be restarted manually!"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
# Always create required tmpfiles in case a service
|
||||||
|
# needs any of them.
|
||||||
|
systemd-tmpfiles --create
|
||||||
fi
|
fi
|
||||||
shift; shift
|
shift; shift
|
||||||
done
|
done
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Template file for 'xbps-triggers'
|
# Template file for 'xbps-triggers'
|
||||||
pkgname=xbps-triggers
|
pkgname=xbps-triggers
|
||||||
version=0.37
|
version=0.38
|
||||||
short_desc="XBPS triggers"
|
short_desc="XBPS triggers"
|
||||||
maintainer="Juan RP <xtraeme@gmail.com>"
|
maintainer="Juan RP <xtraeme@gmail.com>"
|
||||||
homepage="http://code.google.com/p/xbps"
|
homepage="http://code.google.com/p/xbps"
|
||||||
|
@ -12,8 +12,7 @@ noarch=yes
|
||||||
noextract=yes
|
noextract=yes
|
||||||
bootstrap=yes
|
bootstrap=yes
|
||||||
|
|
||||||
do_install()
|
do_install() {
|
||||||
{
|
|
||||||
_triggersdir=var/db/xbps/triggers
|
_triggersdir=var/db/xbps/triggers
|
||||||
|
|
||||||
for f in ${FILESDIR}/*; do
|
for f in ${FILESDIR}/*; do
|
||||||
|
|
Loading…
Reference in New Issue