From fa873879c4bf906a08af1c87281d2c55798f3ac5 Mon Sep 17 00:00:00 2001 From: Jiří Popelka Date: Sep 23 2009 14:31:50 +0000 Subject: - Fixed cups.init to be LSB compliant (bug #521641) --- diff --git a/cups.init b/cups.init index 4a6764f..09f7171 100644 --- a/cups.init +++ b/cups.init @@ -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 diff --git a/cups.spec b/cups.spec index 13af6fa..efd79e8 100644 --- a/cups.spec +++ b/cups.spec @@ -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 1:1.4.1-5 +- Fixed cups.init to be LSB compliant (bug #521641) + * Mon Sep 21 2009 Jiri Popelka 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