- Fixed cups.init to be LSB compliant (bug #521641)

This commit is contained in:
Jiří Popelka 2009-09-23 14:31:50 +00:00
parent 3f10348a3f
commit fa873879c4
2 changed files with 16 additions and 10 deletions

View File

@ -43,23 +43,25 @@
### END INIT INFO
# Source function library.
. /etc/init.d/functions
. /etc/rc.d/init.d/functions
DAEMON=cupsd
exec=/usr/sbin/cupsd
prog=cups
config=/etc/cups/cupsd.conf
lockfile=/var/lock/subsys/$DAEMON
check() {
# Check that we're a privileged user
[ `id -u` = 0 ] || exit 4
# Check if cupsd is executable
[ -x /usr/sbin/cupsd ] || exit 5
[ -x $exec ] || exit 5
}
start () {
check
[ -f /etc/cups/cupsd.conf ] || exit 6
[ -f $config ] || exit 6
echo -n $"Starting $prog: "
@ -70,7 +72,7 @@ start () {
daemon $DAEMON
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/cups
[ $RETVAL = 0 ] && touch $lockfile
udevadm trigger --subsystem-match=usb \
--attr-match=bInterfaceClass=07 \
@ -89,7 +91,7 @@ stop () {
killproc $DAEMON
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/cups
[ $RETVAL = 0 ] && rm -f $lockfile
return 0
}
@ -109,7 +111,7 @@ case $1 in
restart
;;
condrestart|try-restart)
[ -f /var/lock/subsys/cups ] && restart || :
[ -f $lockfile ] && restart || :
;;
reload)
echo -n $"Reloading $prog: "
@ -125,7 +127,7 @@ case $1 in
echo
;;
status)
status cups
status $DAEMON
RETVAL=$?
;;
restartlog)
@ -135,7 +137,7 @@ case $1 in
;;
*)
echo $"Usage: $prog {start|stop|restart|condrestart|reload|status}"
echo $"Usage: $prog {start|stop|restart|condrestart|try-restart|reload|force-reload|status}"
exit 2
esac

View File

@ -9,7 +9,7 @@
Summary: Common Unix Printing System
Name: cups
Version: 1.4.1
Release: 4%{?dist}
Release: 5%{?dist}
License: GPLv2
Group: System Environment/Daemons
Source: http://ftp.easysw.com/pub/cups/1.4.0/cups-%{version}-source.tar.bz2
@ -505,6 +505,10 @@ rm -rf $RPM_BUILD_ROOT
%{php_extdir}/phpcups.so
%changelog
* Wed Sep 23 2009 Jiri Popelka <jpopelka@redhat.com> 1:1.4.1-5
- Fixed cups.init to be LSB compliant (bug #521641)
* Mon Sep 21 2009 Jiri Popelka <jpopelka@redhat.com> 1:1.4.1-4
- Changed cups.init to be LSB compliant (bug #521641), i.e.
return code "2" (instead of "3") if invalid arguments