[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#475508: marked as done (Avoid undesired startup)



Your message dated Fri, 11 Apr 2008 07:48:22 -0500
with message-id <20080411124822.GP6218@piware.de>
and subject line Re: [Pkg-cups-devel] Bug#475508: Avoid undesired startup
has caused the Debian Bug report #475508,
regarding Avoid undesired startup
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
475508: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=475508
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: cupsys
Version: 1.3.7-1
Severity: wishlist

After every upgrade the cupsd is started even it was intentionally not
running.

I adapted the implementation from rsync to avoid this behavior:

--- /etc/default/cupsys 2008-04-11 11:02:25.000000000 +0000
+++ /etc/default/cupsys.patched 2008-04-11 11:02:16.000000000 +0000
@@ -1,4 +1,8 @@
 # Cups configure options

+# start cupsys in daemon mode from init.d script?
+#  only allowed values are "true" and "false"
+CUPSYS_ENABLE=false
+
 # LOAD_LP_MODULE: enable/disable to load "lp" parallel printer driver module
 LOAD_LP_MODULE=yes


--- /etc/init.d/cupsys  2008-04-11 11:03:30.000000000 +0000
+++ /etc/init.d/cupsys.patched  2008-04-11 11:14:11.000000000 +0000
@@ -17,6 +17,8 @@
 NAME=cupsd
 PIDFILE=/var/run/cups/$NAME.pid
 DESC="Common Unix Printing System"
+CUPSYS_ENABLE=false
+CUPSYS_DEFAULTS_FILE=/etc/default/cupsys

 unset TMPDIR

@@ -24,8 +26,15 @@

 set -e

-if [ -r /etc/default/cupsys ]; then
-  . /etc/default/cupsys
+if [ -s $CUPSYS_DEFAULTS_FILE ]; then
+    . $CUPSYS_DEFAULTS_FILE
+    case "x$CUPSYS_ENABLE" in
+        xtrue|xfalse)   ;;
+        *)              log_failure_msg "Value of CUPSYS_ENABLE in $CUPSYS_DEFAULTS_FILE must be either 'true' or 'false';"
+                        log_failure_msg "not starting $NAME daemon."
+                        exit 1
+                        ;;
+    esac
 fi

 . /lib/lsb/init-functions
@@ -38,20 +47,24 @@

 case "$1" in
   start)
-       log_begin_msg "Starting $DESC: $NAME"
-       chown root:lpadmin /usr/share/ppd/custom 2>/dev/null || true
-       chmod 3775 /usr/share/ppd/custom 2>/dev/null || true
-
-       mkdir -p `dirname "$PIDFILE"`
-       if [ "$LOAD_LP_MODULE" = "yes" -a -f /usr/lib/cups/backend/parallel \
-             -a -f /proc/devices -a -f /proc/modules -a -x /sbin/modprobe ]; then
-         modprobe -q lp || true
-         modprobe -q ppdev || true
+       if "$CUPSYS_ENABLE"; then
+           log_begin_msg "Starting $DESC: $NAME"
+           chown root:lpadmin /usr/share/ppd/custom 2>/dev/null || true
+           chmod 3775 /usr/share/ppd/custom 2>/dev/null || true
+
+           mkdir -p `dirname "$PIDFILE"`
+           if [ "$LOAD_LP_MODULE" = "yes" -a -f /usr/lib/cups/backend/parallel \
+                -a -f /proc/devices -a -f /proc/modules -a -x /sbin/modprobe ]; then
+             modprobe -q lp || true
+             modprobe -q ppdev || true
+           fi
+
+           start-stop-daemon --start --quiet --oknodo --pidfile "$PIDFILE" --exec $DAEMON
+
+           log_end_msg $?
+        else
+            [ "$VERBOSE" != no ] && log_warning_msg "$NAME daemon not enabled in $CUPSYS_DEFAULTS_FILE, not starting..."
        fi
-
-       start-stop-daemon --start --quiet --oknodo --pidfile "$PIDFILE" --exec $DAEMON
-
-       log_end_msg $?
        ;;
   stop)
        log_begin_msg "Stopping $DESC: $NAME"
@@ -64,11 +77,15 @@
        log_end_msg $?
        ;;
   restart)
-       log_begin_msg "Restarting $DESC: $NAME"
-       if start-stop-daemon --stop --quiet --retry 5 --oknodo --pidfile $PIDFILE --name $NAME; then
-               start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec $DAEMON
+       if "$CUPSYS_ENABLE"; then
+           log_begin_msg "Restarting $DESC: $NAME"
+           if start-stop-daemon --stop --quiet --retry 5 --oknodo --pidfile $PIDFILE --name $NAME; then
+                   start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec $DAEMON
+           fi
+           log_end_msg $?
+        else
+            [ "$VERBOSE" != no ] && log_warning_msg "$NAME daemon not enabled in $CUPSYS_DEFAULTS_FILE, not starting..."
        fi
-       log_end_msg $?
        ;;
   status)
        echo -n "Status of $DESC: "
                                                                                                                                                                        
-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger



--- End Message ---
--- Begin Message ---
Hi Markus,

Dr. Markus Waldeck [2008-04-11 11:23 +0200]:
> After every upgrade the cupsd is started even it was intentionally not
> running.
> 
> I adapted the implementation from rsync to avoid this behavior:

rsync ships both a daemon and a client-side program, so it makes sense
to ship the package with the daemon disabled by default.

However, since the cupsys package is explicitly "the cups server", it
does *not* make sense to do so.

default files should not be used for disabling a server which is
started by default on package installation. That's what the
/etc/rc?.d/ symlinks are for, so if you want cups not to start by
default, please configure the symlinks accordingly.

Thanks,

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)


--- End Message ---

Reply to: