Control: tags -1 +patch +pending
Hi there Russell; thanks for your report!
Le mercredi, 22 mars 2017, 00.30:13 h CET Russell Coker a écrit :
> /run has been around since 2011, I think it's time to stop using the
> /var/run symlink. Supporting the symlink in SE Linux means supporting both
> names for the contexts used in the initial creation of files and
> directories which I want to remove. Here's a patch to make cups not use
> /var/run:
Actually, if we are to remove /var/run usages, we might as well want to do it
everywhere, and for all usages:
* /run/cups/$NAME.pid (in the pidfile.patch, and in the init script)
* /run/cups/printcap (through --with-printcap, managed in the postinst)
* /run/cups/certs (through --with-rundir, handled in the init script and in
the upstart script)
* /run/cups/cups.sock (through --with-rundir, used in cups.postinst and
trigger, in the upstart script as well as in the autopkgtest
A patch for that all is attached, and, given that we have experimental, I will
upload that soon. Thanks for the heads' up!
--
OdyXAuthor: Didier Raboud
Date: Tue Mar 21 21:15:44 2017 +0100
Use /run instead of /var/run everywhere meaningful:
* /run/cups:
- in debian/rules; pass --with-rundir=/run/cups
- update cups.init
* /run/cups/cupsd.pid:
- update cups.init
- update pidfile.patch
* /run/cups/printcap:
- in debian/rules; update --with-printcap
- update cups-daemon postinst
* /run/cups/cups.sock:
- update cups postinst and postrm for the lpadmin calls
- update the autopkgtest for the lpadmin call
- update the libcups2 example script
- update the upstart script
* /run/cups/certs:
- update cups.init
- update the upstart script
Thanks-To: Russell Coker
Closes: #858341
diff --git a/debian/client.conf b/debian/client.conf
index 5081adeaf..b8e1c0149 100644
--- a/debian/client.conf
+++ b/debian/client.conf
@@ -34,7 +34,7 @@
#
# ServerName: the hostname of your server. By default CUPS will use the
-# domain socket /var/run/cups/cups.sock or the value of the CUPS_SERVER
+# domain socket /run/cups/cups.sock or the value of the CUPS_SERVER
# environment variable.
# ONLY ONE SERVER NAME MAY BE SPECIFIED AT A TIME. To use
# more than one server you must use a local scheduler with browsing
diff --git a/debian/cups-daemon.cups.init b/debian/cups-daemon.cups.init
index bfb08d0ad..7b6277524 100644
--- a/debian/cups-daemon.cups.init
+++ b/debian/cups-daemon.cups.init
@@ -19,7 +19,7 @@
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
+PIDFILE=/run/cups/$NAME.pid
DESC="Common Unix Printing System"
SCRIPTNAME=/etc/init.d/cups
@@ -28,8 +28,8 @@ unset TMPDIR
# Exit if the package is not installed
test -x $DAEMON || exit 0
-mkdir -p /var/run/cups/certs
-[ -x /sbin/restorecon ] && /sbin/restorecon -R /var/run/cups
+mkdir -p /run/cups/certs
+[ -x /sbin/restorecon ] && /sbin/restorecon -R /run/cups
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
diff --git a/debian/cups-daemon.postinst b/debian/cups-daemon.postinst
index cf09db6bc..e485a7526 100644
--- a/debian/cups-daemon.postinst
+++ b/debian/cups-daemon.postinst
@@ -63,7 +63,7 @@ if [ "$1" = configure ]; then
printcap_file=`egrep '^Printcap ' /etc/cups/cupsd.conf | awk '{print $2}' | tail -n 1`
if [ -z "$printcap_file" ]; then
- printcap_file=/var/run/cups/printcap
+ printcap_file=/run/cups/printcap
fi
if [ ! -e /etc/printcap -a -e $printcap_file ]; then
ln -s $printcap_file /etc/printcap
diff --git a/debian/cups-daemon.postrm b/debian/cups-daemon.postrm
index 42c01b083..25cfca367 100644
--- a/debian/cups-daemon.postrm
+++ b/debian/cups-daemon.postrm
@@ -8,7 +8,7 @@ case "$1" in
purge)
rm -rf /var/lib/cups
rm -rf /var/log/cups
- rm -rf /var/run/cups
+ rm -rf /run/cups
rm -rf /var/cache/cups
rm -rf /var/spool/cups
rm -f /etc/cups/ssl/server.crt
diff --git a/debian/cups.postinst b/debian/cups.postinst
index 143d2d2c4..093fc2220 100644
--- a/debian/cups.postinst
+++ b/debian/cups.postinst
@@ -103,7 +103,7 @@ ppd_updater () {
for ppd in *.ppd; do
[ -r "$ppd" ] || continue
queue=${ppd%.ppd}
- lpstat -h /var/run/cups/cups.sock -p "$queue" >/dev/null 2>&1 || continue
+ lpstat -h /run/cups/cups.sock -p "$queue" >/dev/null 2>&1 || continue
nickname=`grep '\*NickName:' "$ppd" | cut -d '"' -f 2 | perl -p -e 's/\n$//' | perl -p -e "$gennicknameregexp" | perl -p -e 's/(\W)/$1/g'`
lang=`grep '\*LanguageVersion:' "$ppd" | cut -d ' ' -f 2 | perl -e 'print lc(<>)' | perl -p -e 's/[\r\n]//gs'`
ppdfound="0"
@@ -112,12 +112,12 @@ ppd_updater () {
tempfiles="$tempfiles $tmpfile2"
cat $tmpfile1 | perl -p -e "$gennicknameregexp; s/\n*$/\n/s" | grep -E '^\S+\s+.*'"$nickname"'$' | cut -d ' ' -f 1 > $tmpfile2
whi