mirror of
https://github.com/void-linux/void-packages.git
synced 2025-06-15 03:23:50 +02:00
xbps-triggers: do not stop/restart services, show info messages instead. Bump to 0.10.
This commit is contained in:
parent
6e66bc827d
commit
cc34440b6c
2 changed files with 28 additions and 29 deletions
|
@ -45,7 +45,6 @@ run)
|
||||||
set -- ${openrc_services}
|
set -- ${openrc_services}
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
unset skip_service
|
unset skip_service
|
||||||
srv_restart=$metadatadir/.$1_srv_restart
|
|
||||||
if [ "$TARGET" = "post-install" ]; then
|
if [ "$TARGET" = "post-install" ]; then
|
||||||
# The service shouldn't be registered, so just show a message
|
# The service shouldn't be registered, so just show a message
|
||||||
# explaining how to add it in the future.
|
# explaining how to add it in the future.
|
||||||
|
@ -59,10 +58,10 @@ run)
|
||||||
esac
|
esac
|
||||||
if [ -n "$skip_service" ]; then
|
if [ -n "$skip_service" ]; then
|
||||||
cat <<_EOF
|
cat <<_EOF
|
||||||
================================================================
|
=========================================================================
|
||||||
|
|
||||||
The system service '${1}' won't be added into the runlevel
|
The system service '${1}' from ${PKGNAME}-${VERSION} won't be added
|
||||||
'${2}' by default, so it will remain disabled at boot.
|
into the runlevel '${2}' by default, so it will remain disabled at boot.
|
||||||
|
|
||||||
To start it at boot time, use the following command:
|
To start it at boot time, use the following command:
|
||||||
|
|
||||||
|
@ -72,40 +71,40 @@ To disable it again use:
|
||||||
|
|
||||||
$ rc-update del ${1} ${2}
|
$ rc-update del ${1} ${2}
|
||||||
|
|
||||||
================================================================
|
=========================================================================
|
||||||
_EOF
|
_EOF
|
||||||
shift; shift; shift;
|
shift; shift; shift;
|
||||||
continue
|
continue
|
||||||
else
|
|
||||||
echo "Registering '${1}' service to start at boot."
|
|
||||||
fi
|
fi
|
||||||
if [ -f $srv_restart ]; then
|
# Register service.
|
||||||
# Restart service if it was running previously.
|
sbin/rc-service -e ${1}
|
||||||
$initdir/$1 start
|
if [ $? -ne 0 ]; then
|
||||||
rm -f $srv_restart
|
sbin/rc-update add ${1} ${2}
|
||||||
else
|
echo "Registering '${1}' from ${PKGNAME} service to start at boot."
|
||||||
# Register service.
|
|
||||||
if sbin/rc-service -e ${1}; then
|
|
||||||
sbin/rc-update add ${1} ${2}
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# While removing always stop the service if running.
|
|
||||||
$initdir/$1 -q status
|
$initdir/$1 -q status
|
||||||
if [ $? -eq 0 ]; then
|
rv=$?
|
||||||
$initdir/$1 stop
|
|
||||||
fi
|
if [ "$UPDATE" = "no" ]; then
|
||||||
#
|
#
|
||||||
# While upgrading a package, don't remove the service.
|
# If the service is running inform the user that it should be
|
||||||
#
|
# stopped and unregistered manually.
|
||||||
if [ "$UPDATE" = "yes" ]; then
|
#
|
||||||
touch -f $srv_restart
|
if [ $rv -eq 0 ]; then
|
||||||
|
echo "Service ${1} from ${PKGNAME} needs to be stopped!"
|
||||||
|
echo "Please stop the service with '$initdir/$1 stop' and unregister"
|
||||||
|
echo "the service with 'rc-update del ${1} ${2}' manually."
|
||||||
|
else
|
||||||
|
# Unregister the service.
|
||||||
|
sbin/rc-update del ${1} ${2}
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
# Unregister the service.
|
if [ $rv -eq 0 ]; then
|
||||||
sbin/rc-update del ${1} ${2}
|
echo "Service '${1}' from ${PKGNAME} should be restarted!"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
unset srv_restart
|
|
||||||
shift; shift; 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.9
|
version=0.10
|
||||||
build_style=custom-install
|
build_style=custom-install
|
||||||
short_desc="XBPS triggers"
|
short_desc="XBPS triggers"
|
||||||
maintainer="Juan RP <xtraeme@gmail.com>"
|
maintainer="Juan RP <xtraeme@gmail.com>"
|
||||||
|
|
Loading…
Add table
Reference in a new issue