From b48cec94e98200914d60997ea974e5b35c2c2c31 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 20 Jul 2011 18:53:13 +0200 Subject: [PATCH] xbps-triggers: improvements to the openrc trigger. --- srcpkgs/xbps-triggers/files/openrc-service | 29 ++++++++++++++-------- srcpkgs/xbps-triggers/template | 4 +-- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/srcpkgs/xbps-triggers/files/openrc-service b/srcpkgs/xbps-triggers/files/openrc-service index a2aa6186338..2ecf8ebec61 100755 --- a/srcpkgs/xbps-triggers/files/openrc-service +++ b/srcpkgs/xbps-triggers/files/openrc-service @@ -46,10 +46,7 @@ run) set -- ${openrc_services} while [ $# -gt 0 ]; do - unset skip_service if [ "$TARGET" = "post-install" ]; then - # The service shouldn't be registered, so just show a message - # explaining how to add it in the future. case "$3" in [Ff][Aa][Ll][Ss][Ee]|[Oo][Ff]|0) skip_service=1 @@ -59,11 +56,13 @@ run) ;; esac if [ -n "$skip_service" ]; then + # The service shouldn't be registered, so just show a message + # explaining how to add it in the future. cat <<_EOF ========================================================================= -The system service '${1}' from ${PKGNAME}-${VERSION} won't be added -into the runlevel '${2}' by default, so it will remain disabled at boot. +The service '${1}' from '${PKGNAME}-${VERSION}' won't be registered +into the runlevel '${2}', therefore it will remain disabled at boot. To start it at boot time, use the following command: @@ -73,6 +72,10 @@ To disable it again use: $ rc-update del ${1} ${2} +To start the service: + + $ rc-service start ${1} + ========================================================================= _EOF shift; shift; shift; @@ -81,33 +84,37 @@ _EOF # Register service. if [ "$UPDATE" = "no" ]; then sbin/rc-update add ${1} ${2} - echo "Registering '${1}' from ${PKGNAME} service to start at boot." fi else + # + # pre-remove + # $initdir/$1 -q status rv=$? if [ "$UPDATE" = "no" ]; then # # If the service is running inform the user that it should be - # stopped and unregistered manually. + # stopped before removing the package! # 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." + echo "ERROR: service '${1}' from '${PKGNAME}-${VERSION}' must be stopped!" + echo "ERROR: please stop the service with 'rc-service $1 stop' and try again." + error=1 else # Unregister the service. sbin/rc-update del ${1} ${2} fi else if [ $rv -eq 0 ]; then - echo "Service '${1}' from ${PKGNAME} should be restarted!" + echo "WARNING: service '${1}' from '${PKGNAME}-${VERSION}' must be restarted!" + echo "WARNING: you can restart it with 'rc-service $1 restart'." fi fi fi shift; shift; shift; done + [ -n "$error" ] && exit $error ;; *) exit 1 diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template index b12e299312e..d48589b515f 100644 --- a/srcpkgs/xbps-triggers/template +++ b/srcpkgs/xbps-triggers/template @@ -1,11 +1,11 @@ # Template file for 'xbps-triggers' pkgname=xbps-triggers -version=0.18 +version=0.19 build_style=custom-install short_desc="XBPS triggers" maintainer="Juan RP " homepage="http://code.google.com/p/xbps" -license="BSD" +license="Simplified BSD" long_desc=" This package installs the triggers used by the XBPS binary packages."