tags 633035 + patch thanks Hi there!
On Fri, 08 Jul 2011 00:34:49 +0200, Roger Leigh wrote: > Your package is currently using/lib/init/rw/sendsigs.omit.d > which is now deprecated and pending removal. Please update your > package to use /run/sendsigs.omit.d with a versioned dependency > on initscripts, as detailed below. [...] > For sendsigs.omit.d, we would recommend that you: > > * Depend on initscripts (>= 2.88dsf-13.3) > * Replace *all* usage of /lib/init/rw with /run > * Move all files in /lib/init/rw to /run in the package postinst, for > example: > > if [ -f /lib/init/rw/sendsigs.omit.d/foo ]; then > mv /lib/init/rw/sendsigs.omit.d/foo /run/sendsigs.omit.d/foo > fi Below is a proposed patch, with the following notes: 1) it moves everything Debian-related from /var/run to /run. This does not include upstream changes, nor it considers upstream usage of /var/run for the lock file (it should be /var/lock, thus /run/lock). 2) it does not create /run/sendsigs.omit.d because this is done in /etc/init.d/mountkernfs.sh:91 with *proper* permissions (755). 3) the pid file is created in /run and then symlinked to /run/sendsigs.omit.d (similar to rsyslog and statd/nfs-common) and not the other way around. 4) it does not remove the symlink in /run/sendsigs.omit.d when the daemon is stopped (again similar to rsyslog and statd/nfs-common). The patch has been tested on a clean and up-to-date sid with the following package: <http://people.debian.org/~gismo/tmp/rpcbind_0.2.0-7~gismo633035.1_amd64.deb> --8<---------------cut here---------------start------------->8--- diff -Naur rpcbind-0.2.0.ORG/debian/changelog rpcbind-0.2.0/debian/changelog --- rpcbind-0.2.0.ORG/debian/changelog 2011-03-19 16:05:20.000000000 +0100 +++ rpcbind-0.2.0/debian/changelog 2011-09-28 17:53:06.989896628 +0200 @@ -1,3 +1,24 @@ +rpcbind (0.2.0-7) UNRELEASED; urgency=low + + [ Luca Capello ] + * debian/control: + + Depends: on initscripts (>= 2.88dsf-13.3) for /run transition. + * debian/init.d: + + STATEDIR is now on /run. + + add PIDFILE variable. + + migrate to /run/sendsigs.omit.d/ creating the PIDFILE in /run + and symlinking it (Closes: #633035). + + remove PIDFILE on stop. + * debian/postinst: + + move /lib/init/rw/sendsigs.omit.d/rpcbind to /run/rpcbind.pid + and symlink it to /run/sendsigs.omit.d/rpcbind. + * debian/postrm: + + remove files in /run, not /var/run. + * debian/rules: + + use /run/rpcbind for --with-statedir. + + -- + rpcbind (0.2.0-6) unstable; urgency=medium * Depend on fixed insserv (or use file-rc). Closes: #618881 diff -Naur rpcbind-0.2.0.ORG/debian/control rpcbind-0.2.0/debian/control --- rpcbind-0.2.0.ORG/debian/control 2011-03-19 15:54:53.000000000 +0100 +++ rpcbind-0.2.0/debian/control 2011-09-28 15:30:30.036622275 +0200 @@ -9,7 +9,7 @@ Package: rpcbind Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base (>= 3.2-14), insserv (>= 1.14.0-2.1) | file-rc +Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base (>= 3.2-14), insserv (>= 1.14.0-2.1) | file-rc, initscripts (>= 2.88dsf-13.3) Conflicts: portmap Provides: portmap Description: converts RPC program numbers into universal addresses diff -Naur rpcbind-0.2.0.ORG/debian/init.d rpcbind-0.2.0/debian/init.d --- rpcbind-0.2.0.ORG/debian/init.d 2011-03-12 17:42:26.000000000 +0100 +++ rpcbind-0.2.0/debian/init.d 2011-09-28 15:04:18.808448151 +0200 @@ -21,7 +21,9 @@ . /lib/lsb/init-functions OPTIONS="-w" -STATEDIR=/var/run/rpcbind +STATEDIR=/run/rpcbind +PIDFILE=/run/rpcbind.pid + if [ -f /etc/default/rpcbind ] then . /etc/default/rpcbind @@ -49,10 +51,11 @@ exit 0 fi start-stop-daemon --start --quiet --oknodo --exec /sbin/rpcbind -- "$@" - log_end_msg $? - mkdir -p /lib/init/rw/sendsigs.omit.d pid=$( pidofproc /sbin/rpcbind ) - echo -n "$pid" > /lib/init/rw/sendsigs.omit.d/rpcbind + echo -n "$pid" >"$PIDFILE" + # /run/sendsigs.omit.d is created by /etc/init.d/mountkernfs.sh + ln -sf "$PIDFILE" /run/sendsigs.omit.d/rpcbind + log_end_msg $? } @@ -60,6 +63,7 @@ { log_begin_msg "Stopping rpcbind daemon..." start-stop-daemon --stop --quiet --oknodo --exec /sbin/rpcbind + rm -f "$PIDFILE" log_end_msg $? } diff -Naur rpcbind-0.2.0.ORG/debian/postinst rpcbind-0.2.0/debian/postinst --- rpcbind-0.2.0.ORG/debian/postinst 1970-01-01 01:00:00.000000000 +0100 +++ rpcbind-0.2.0/debian/postinst 2011-09-28 15:27:37.868224897 +0200 @@ -0,0 +1,15 @@ +#!/bin/sh + +set -e + +if [ "$1" = configure ] ; then + # /run transition (see #633035) + if dpkg --compare-versions "$2" lt "0.2.0-7"; then + if [ -f /lib/init/rw/sendsigs.omit.d/rpcbind ]; then + mv /lib/init/rw/sendsigs.omit.d/rpcbind /run/rpcbind.pid + ln -s /run/rpcbind.pid /run/sendsigs.omit.d/rpcbind + fi + fi +fi + +#DEBHELPER# diff -Naur rpcbind-0.2.0.ORG/debian/postrm rpcbind-0.2.0/debian/postrm --- rpcbind-0.2.0.ORG/debian/postrm 2010-07-17 22:09:34.000000000 +0200 +++ rpcbind-0.2.0/debian/postrm 2011-09-28 16:05:26.633816517 +0200 @@ -3,7 +3,7 @@ set -e if [ "$1" = purge ] ; then - rm -rf /var/run/rpcbind /var/run/rpcbind.lock /var/run/rpcbind.sock + rm -rf /run/rpcbind /run/rpcbind.lock /run/rpcbind.sock fi #DEBHELPER# diff -Naur rpcbind-0.2.0.ORG/debian/rules rpcbind-0.2.0/debian/rules --- rpcbind-0.2.0.ORG/debian/rules 2011-03-12 17:58:34.000000000 +0100 +++ rpcbind-0.2.0/debian/rules 2011-09-28 16:02:15.352966119 +0200 @@ -18,7 +18,7 @@ dh_testdir # Add here commands to configure the package. cp -f /usr/share/misc/config.sub /usr/share/misc/config.guess . - ./configure $(CROSS) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs" --enable-warmstarts --enable-libwrap --with-statedir=/var/run/rpcbind + ./configure $(CROSS) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs" --enable-warmstarts --enable-libwrap --with-statedir=/run/rpcbind build: build-stamp --8<---------------cut here---------------end--------------->8--- Thx, bye, Gismo / Luca
pgpvrbP2JP7PU.pgp
Description: PGP signature