From 3f10348a3f794cfc2c0f4f2e217014d0edceb4c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Popelka?= Date: Mon, 21 Sep 2009 13:57:36 +0000 Subject: [PATCH] - Changed cups.init to be LSB compliant (bug #521641), i.e. return code "2" (instead of "3") if invalid arguments return code "4" if restarting service under nonprivileged user return code "5" if cupsd not exist or is not executable return code "6" if cupsd.conf not exist --- cups.init | 15 ++++++++++++++- cups.spec | 9 ++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/cups.init b/cups.init index ad97614..4a6764f 100644 --- a/cups.init +++ b/cups.init @@ -49,7 +49,18 @@ DAEMON=cupsd prog=cups +check() { + # Check that we're a privileged user + [ `id -u` = 0 ] || exit 4 + + # Check if cupsd is executable + [ -x /usr/sbin/cupsd ] || exit 5 +} + start () { + check + [ -f /etc/cups/cupsd.conf ] || exit 6 + echo -n $"Starting $prog: " # tell portreserve to release the port @@ -71,6 +82,8 @@ start () { } stop () { + check + # stop daemon echo -n $"Stopping $prog: " killproc $DAEMON @@ -123,7 +136,7 @@ case $1 in *) echo $"Usage: $prog {start|stop|restart|condrestart|reload|status}" - exit 3 + exit 2 esac exit $RETVAL diff --git a/cups.spec b/cups.spec index e6cfe63..13af6fa 100644 --- a/cups.spec +++ b/cups.spec @@ -9,7 +9,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.4.1 -Release: 3%{?dist} +Release: 4%{?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,13 @@ rm -rf $RPM_BUILD_ROOT %{php_extdir}/phpcups.so %changelog +* 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 + return code "4" if restarting service under nonprivileged user + return code "5" if cupsd not exist or is not executable + return code "6" if cupsd.conf not exist + * Wed Sep 16 2009 Tomas Mraz 1:1.4.1-3 - Use password-auth common PAM configuration instead of system-auth when available.