rpms/cups/devel cups.init,1.20,1.21 cups.spec,1.520,1.521

Jiří Popelka jpopelka at fedoraproject.org
Mon Sep 21 13:57:36 UTC 2009


Author: jpopelka

Update of /cvs/pkgs/rpms/cups/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv13436

Modified Files:
	cups.init cups.spec 
Log Message:
* Mon Sep 21 2009 Jiri Popelka <jpopelka at 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
  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



Index: cups.init
===================================================================
RCS file: /cvs/pkgs/rpms/cups/devel/cups.init,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -p -r1.20 -r1.21
--- cups.init	15 Sep 2009 10:11:01 -0000	1.20
+++ cups.init	21 Sep 2009 13:57:36 -0000	1.21
@@ -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


Index: cups.spec
===================================================================
RCS file: /cvs/pkgs/rpms/cups/devel/cups.spec,v
retrieving revision 1.520
retrieving revision 1.521
diff -u -p -r1.520 -r1.521
--- cups.spec	16 Sep 2009 10:25:32 -0000	1.520
+++ cups.spec	21 Sep 2009 13:57:36 -0000	1.521
@@ -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 <jpopelka at 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
+  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 <tmraz at redhat.com> 1:1.4.1-3
 - Use password-auth common PAM configuration instead of system-auth
   when available.




More information about the fedora-extras-commits mailing list