[Pkg-cups-devel] Bug#677580: cups: please run restorecon after creating a /var/run directory
Russell Coker
russell at coker.com.au
Thu Jun 14 12:41:01 UTC 2012
Package: cups
Version: 1.5.3-1
Severity: normal
Please apply the following patch to the cups init script. On systems which
don't run SE Linux this will not change the operation of the script. But on
SE Linux systems this will cause the directory to be correctly labelled so
everything will work well.
Sorry for the late bug report, it would be nice if we could get this in
wheezy.
--- /etc/init.d/cups.orig 2012-06-14 22:35:54.000000000 +1000
+++ /etc/init.d/cups 2012-06-14 22:36:57.000000000 +1000
@@ -23,6 +23,7 @@
test -x $DAEMON || exit 0
mkdir -p /var/run/cups/certs
+[ -x /sbin/restorecon ] && /sbin/restorecon -R /var/run/cups
if [ -r /etc/default/cups ]; then
. /etc/default/cups
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 3.2.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages cups depends on:
ii adduser 3.113+nmu3
ii bc 1.06.95-2+b1
ii cups-client 1.5.3-1
ii cups-common 1.5.3-1
ii cups-filters 1.0.18-2+b2
ii cups-ppdc 1.5.3-1
ii debconf [debconf-2.0] 1.5.43
ii dpkg 1.16.4.2
ii ghostscript 9.05~dfsg-6
ii libacl1 2.2.51-7
ii libavahi-client3 0.6.31-1
ii libavahi-common3 0.6.31-1
ii libc6 2.13-33
ii libcups2 1.5.3-1
ii libcupscgi1 1.5.3-1
ii libcupsimage2 1.5.3-1
ii libcupsmime1 1.5.3-1
ii libcupsppdc1 1.5.3-1
ii libdbus-1-3 1.6.0-1
ii libgcc1 1:4.7.0-13
ii libgnutls26 2.12.20-1
ii libgssapi-krb5-2 1.10.1+dfsg-1
ii libkrb5-3 1.10.1+dfsg-1
ii libldap-2.4-2 2.4.28-1.3
ii libpam0g 1.1.3-7.1
ii libpaper1 1.1.24+nmu2
ii libslp1 1.2.1-9
ii libstdc++6 4.7.0-13
ii libusb-1.0-0 2:1.0.11-1
ii lsb-base 4.1+Debian7
ii poppler-utils 0.18.4-2
ii procps 1:3.3.3-1
ii ssl-cert 1.0.29
Versions of packages cups recommends:
pn avahi-daemon <none>
pn colord <none>
ii foomatic-filters 4.0.15-1
ii ghostscript-cups 9.05~dfsg-6
pn printer-driver-gutenprint <none>
Versions of packages cups suggests:
ii cups-bsd 1.5.3-1
ii cups-pdf 2.6.1-6
ii foomatic-db 20120523-1
pn hplip <none>
ii printer-driver-hpcups 3.12.4-2
ii smbclient 2:3.6.5-7
ii udev 175-3.1
-- Configuration Files:
/etc/init.d/cups changed:
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/cupsd
NAME=cupsd
PIDFILE=/var/run/cups/$NAME.pid
DESC="Common Unix Printing System"
unset TMPDIR
test -x $DAEMON || exit 0
mkdir -p /var/run/cups/certs
[ -x /sbin/restorecon ] && /sbin/restorecon -R /var/run/cups
if [ -r /etc/default/cups ]; then
. /etc/default/cups
fi
. /lib/lsb/init-functions
if [ -z "$TZ" -a -e /etc/timezone ]; then
TZ=`cat /etc/timezone`
export TZ
fi
restart_xprint() {
if [ -n "$success" ] && [ -x /etc/init.d/xprint ]; then
invoke-rc.d xprint force-reload || true
fi
}
coldplug_usb_printers() {
if type udevadm > /dev/null 2>&1 && [ -x /lib/udev/udev-configure-printer ]; then
for printer in `udevadm trigger --verbose --dry-run --subsystem-match=usb \
--attr-match=bInterfaceClass=07 --attr-match=bInterfaceSubClass=01 2>/dev/null || true; \
udevadm trigger --verbose --dry-run --subsystem-match=usb \
--sysname-match='lp[0-9]*' 2>/dev/null || true`; do
/lib/udev/udev-configure-printer add "${printer#/sys}"
done
fi
}
case "$1" in
start)
log_begin_msg "Starting $DESC: $NAME"
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 -b lp || true
modprobe -q -b ppdev || true
modprobe -q -b parport_pc || true
fi
start-stop-daemon --start --quiet --oknodo --pidfile "$PIDFILE" --exec $DAEMON && success=1
coldplug_usb_printers
log_end_msg $?
restart_xprint
;;
stop)
log_begin_msg "Stopping $DESC: $NAME"
start-stop-daemon --stop --quiet --retry 5 --oknodo --pidfile $PIDFILE --name $NAME && success=1
log_end_msg $?
restart_xprint
;;
reload|force-reload)
log_begin_msg "Reloading $DESC: $NAME"
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME --signal 1 && success=1
log_end_msg $?
restart_xprint
;;
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 && success=1
fi
log_end_msg $?
restart_xprint
;;
status)
echo -n "Status of $DESC: "
if [ ! -r "$PIDFILE" ]; then
echo "$NAME is not running."
exit 3
fi
if read pid < "$PIDFILE" && ps -p "$pid" > /dev/null 2>&1; then
echo "$NAME is running."
exit 0
else
echo "$NAME is not running but $PIDFILE exists."
exit 1
fi
;;
*)
N=/etc/init.d/${0##*/}
echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac
exit 0
-- debconf information excluded
More information about the Pkg-cups-devel
mailing list