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

View File

@ -9,7 +9,7 @@
Summary: Common Unix Printing System Summary: Common Unix Printing System
Name: cups Name: cups
Version: 1.4.1 Version: 1.4.1
Release: 4%{?dist} Release: 5%{?dist}
License: GPLv2 License: GPLv2
Group: System Environment/Daemons Group: System Environment/Daemons
Source: http://ftp.easysw.com/pub/cups/1.4.0/cups-%{version}-source.tar.bz2 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 %{php_extdir}/phpcups.so
%changelog %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 * 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. - Changed cups.init to be LSB compliant (bug #521641), i.e.
return code "2" (instead of "3") if invalid arguments return code "2" (instead of "3") if invalid arguments