diff -Nru nfs-utils-1.2.8/debian/changelog nfs-utils-1.2.8/debian/changelog --- nfs-utils-1.2.8/debian/changelog 2015-03-06 19:19:58.000000000 +0100 +++ nfs-utils-1.2.8/debian/changelog 2015-03-12 11:49:52.000000000 +0100 @@ -1,3 +1,20 @@ +nfs-utils (1:1.2.8-9ubuntu7) vivid; urgency=medium + + * 27-systemd-enable-with-systemctl-statd.patch: let the admin + enable/disable statd via systemd tools. (LP: #1428486) + * debian/nfs-common.default: remove NEED_STATD and related comment. + * debian/statd{,-mounting}.upstart: remove the usage of NEED_STATD, we'll + directly disable the jobs now. + * debian/rules: don't start statd by default (or it will trigger upstart + and systemd statd unit startup). + * debian/nfs-common.{preinst,postinst}: transition the conffile to the new + template and enable statd services in both upstart and systemd if + NEED_STATD was set to yes. + * debian/control, debian/*install: move nfs-utils.service to nfs-common + package. + + -- Didier Roche Thu, 12 Mar 2015 09:13:06 +0100 + nfs-utils (1:1.2.8-9ubuntu6) vivid; urgency=medium * Revert previous upload; per upstream, rpc.idmapd is not used when the diff -Nru nfs-utils-1.2.8/debian/control nfs-utils-1.2.8/debian/control --- nfs-utils-1.2.8/debian/control 2015-03-06 07:45:34.000000000 +0100 +++ nfs-utils-1.2.8/debian/control 2015-03-12 11:32:03.000000000 +0100 @@ -38,8 +38,8 @@ Suggests: open-iscsi, watchdog Provides: nfs-client Conflicts: nfs-client -Breaks: nfs-kernel-server (<< 1:1.2.8-6~) -Replaces: nfs-client, nfs-kernel-server (<< 1:1.2.8-6~), mount (<< 2.13~) +Breaks: nfs-kernel-server (<< 1:1.2.8-9ubuntu7~) +Replaces: nfs-client, nfs-kernel-server (<< 1:1.2.8-9ubuntu7~), mount (<< 2.13~) Description: NFS support files common to client and server Use this package on any machine that uses NFS, either as client or server. Programs included: lockd, statd, showmount, nfsstat, gssd, diff -Nru nfs-utils-1.2.8/debian/nfs-common.default nfs-utils-1.2.8/debian/nfs-common.default --- nfs-utils-1.2.8/debian/nfs-common.default 2012-10-10 18:15:43.000000000 +0200 +++ nfs-utils-1.2.8/debian/nfs-common.default 2015-03-12 10:17:38.000000000 +0100 @@ -2,8 +2,6 @@ # autodetected; this should be sufficient for most people. Valid alternatives # for the NEED_ options are "yes" and "no". -# Do you want to start the statd daemon? It is not needed for NFSv4. -NEED_STATD= # Options for rpc.statd. # Should rpc.statd listen on a specific port? This is especially useful diff -Nru nfs-utils-1.2.8/debian/nfs-common.install nfs-utils-1.2.8/debian/nfs-common.install --- nfs-utils-1.2.8/debian/nfs-common.install 2015-03-06 07:45:34.000000000 +0100 +++ nfs-utils-1.2.8/debian/nfs-common.install 2015-03-12 11:32:43.000000000 +0100 @@ -28,3 +28,6 @@ systemd/nfs-config.service /lib/systemd/system systemd/nfs-idmapd.service /lib/systemd/system systemd/nfs-client.target /lib/systemd/system +systemd/nfs-utils.service /lib/systemd/system +debian/statd.override /etc/init/ +debian/statd-mounting.override /etc/init/ diff -Nru nfs-utils-1.2.8/debian/nfs-common.postinst nfs-utils-1.2.8/debian/nfs-common.postinst --- nfs-utils-1.2.8/debian/nfs-common.postinst 2014-02-25 17:42:41.000000000 +0100 +++ nfs-utils-1.2.8/debian/nfs-common.postinst 2015-03-12 11:53:17.000000000 +0100 @@ -66,6 +66,17 @@ if [ -f /lib/init/rw/sendsigs.omit.d/statd ]; then mv /lib/init/rw/sendsigs.omit.d/statd /run/sendsigs.omit.d/statd fi + + # Remove enablement flag in conffile + DEFAULT_CONFFILE=/etc/default/nfs-common + if [ -f ${DEFAULT_CONFFILE}.statd.enable ]; then + # enable upstart and systemd jobs. Ignore errors as name mapping isn't one to one + # upstart jobs are not disabled under systemd by update-rc.d wihout sysvinit file. + rm -f /etc/init/statd-mounting.override /etc/init/statd.override + update-rc.d rpc-statd-notify enable >/dev/null 2>&1 || true + update-rc.d rpc-statd enable >/dev/null 2>&1 || true + rm -f ${DEFAULT_CONFFILE}.statd.enable + fi ;; esac diff -Nru nfs-utils-1.2.8/debian/nfs-common.preinst nfs-utils-1.2.8/debian/nfs-common.preinst --- nfs-utils-1.2.8/debian/nfs-common.preinst 2013-11-21 22:32:23.000000000 +0100 +++ nfs-utils-1.2.8/debian/nfs-common.preinst 2015-03-12 11:53:29.000000000 +0100 @@ -28,4 +28,16 @@ fi fi +# Prepare removal of enablement flag in conffile. +DEFAULT_CONFFILE=/etc/default/nfs-common +if [ "$1" = upgrade ]; then + if dpkg --compare-versions "$2" lt-nl 1:1.2.8-9ubuntu7 && [ -f $DEFAULT_CONFFILE ]; then + if egrep -sqi 'NEED_STATD="?yes' $DEFAULT_CONFFILE; then + touch ${DEFAULT_CONFFILE}.statd.enable + fi + sed -i '/#.*statd daemon/d' /etc/default/nfs-common + sed -i '/NEED_STATD/d' /etc/default/nfs-common + fi +fi + #DEBHELPER# diff -Nru nfs-utils-1.2.8/debian/nfs-common.statd-mounting.upstart nfs-utils-1.2.8/debian/nfs-common.statd-mounting.upstart --- nfs-utils-1.2.8/debian/nfs-common.statd-mounting.upstart 2012-10-10 18:15:43.000000000 +0200 +++ nfs-utils-1.2.8/debian/nfs-common.statd-mounting.upstart 2015-03-12 10:26:41.000000000 +0100 @@ -17,7 +17,6 @@ . /etc/default/nfs-common - [ "x$NEED_STATD" != "xno" ] || exit 0 status statd | grep -q "start/running" && exit 0 # If its already starting we'll get killed by the impending 'stop on diff -Nru nfs-utils-1.2.8/debian/nfs-common.statd.upstart nfs-utils-1.2.8/debian/nfs-common.statd.upstart --- nfs-utils-1.2.8/debian/nfs-common.statd.upstart 2015-03-06 07:45:34.000000000 +0100 +++ nfs-utils-1.2.8/debian/nfs-common.statd.upstart 2015-03-12 10:26:54.000000000 +0100 @@ -25,7 +25,6 @@ . "$DEFAULTFILE" fi - [ "x$NEED_STATD" != xno ] || { stop; exit 0; } logger -t statd-pre-start "$UPSTART_EVENTS" || true echo UPSTART_EVENTS = "$UPSTART_EVENTS" diff -Nru nfs-utils-1.2.8/debian/nfs-kernel-server.install nfs-utils-1.2.8/debian/nfs-kernel-server.install --- nfs-utils-1.2.8/debian/nfs-kernel-server.install 2015-03-06 07:45:34.000000000 +0100 +++ nfs-utils-1.2.8/debian/nfs-kernel-server.install 2015-03-12 11:32:32.000000000 +0100 @@ -11,4 +11,3 @@ systemd/nfs-blkmap.service /lib/systemd/system systemd/nfs-mountd.service /lib/systemd/system systemd/nfs-server.service /lib/systemd/system -systemd/nfs-utils.service /lib/systemd/system diff -Nru nfs-utils-1.2.8/debian/patches/27-systemd-enable-with-systemctl-statd.patch nfs-utils-1.2.8/debian/patches/27-systemd-enable-with-systemctl-statd.patch --- nfs-utils-1.2.8/debian/patches/27-systemd-enable-with-systemctl-statd.patch 1970-01-01 01:00:00.000000000 +0100 +++ nfs-utils-1.2.8/debian/patches/27-systemd-enable-with-systemctl-statd.patch 2015-03-12 12:10:48.000000000 +0100 @@ -0,0 +1,66 @@ +Description: Let sysadmins enable/disable statd services + As the admin was able to control under upstart the statd services with + NEED_STATD in default conffiles, mirror this funcationality under systemd + by letting the user systemctl enable/disable statd services. +Author: Didier Roche +Bug-Ubuntu: https://launchpad.net/bugs/1428486 +Index: nfs-utils-1.2.8/systemd/nfs-server.service +=================================================================== +--- nfs-utils-1.2.8.orig/systemd/nfs-server.service ++++ nfs-utils-1.2.8/systemd/nfs-server.service +@@ -3,8 +3,7 @@ Description=NFS server and services + DefaultDependencies=no + Requires= network.target proc-fs-nfsd.mount rpcbind.target + Requires= nfs-mountd.service +-Wants=rpc-statd.service nfs-idmapd.service +-Wants=rpc-statd-notify.service ++Wants=nfs-idmapd.service + + After= local-fs.target + After= network.target proc-fs-nfsd.mount rpcbind.target nfs-mountd.service +Index: nfs-utils-1.2.8/systemd/rpc-statd-notify.service +=================================================================== +--- nfs-utils-1.2.8.orig/systemd/rpc-statd-notify.service ++++ nfs-utils-1.2.8/systemd/rpc-statd-notify.service +@@ -17,3 +17,6 @@ After=nfs-config.service + EnvironmentFile=-/run/sysconfig/nfs-utils + Type=forking + ExecStart=-/sbin/sm-notify $SMNOTIFYARGS ++ ++[Install] ++WantedBy=nfs-client.target +Index: nfs-utils-1.2.8/systemd/rpc-statd.service +=================================================================== +--- nfs-utils-1.2.8.orig/systemd/rpc-statd.service ++++ nfs-utils-1.2.8/systemd/rpc-statd.service +@@ -7,7 +7,7 @@ After=network.target nss-lookup.target r + + PartOf=nfs-utils.service + +-Wants=nfs-config.service ++Wants=nfs-config.service rpc-statd-notify.service + After=nfs-config.service + + [Service] +@@ -15,3 +15,6 @@ EnvironmentFile=-/run/sysconfig/nfs-util + Type=forking + PIDFile=/var/run/rpc.statd.pid + ExecStart=/sbin/rpc.statd --no-notify $STATDARGS ++ ++[Install] ++WantedBy=nfs-server.service +Index: nfs-utils-1.2.8/systemd/nfs-client.target +=================================================================== +--- nfs-utils-1.2.8.orig/systemd/nfs-client.target ++++ nfs-utils-1.2.8/systemd/nfs-client.target +@@ -3,9 +3,7 @@ Description=NFS client services + Before=remote-fs-pre.target + Wants=remote-fs-pre.target + +-# Note: we don't "Wants=rpc-statd.service" as "mount.nfs" will arrange to +-# start that on demand if needed. +-Wants=nfs-blkmap.service rpc-statd-notify.service ++Wants=nfs-blkmap.service + After=nfs-blkmap.service + + # GSS services dependencies and ordering diff -Nru nfs-utils-1.2.8/debian/patches/series nfs-utils-1.2.8/debian/patches/series --- nfs-utils-1.2.8/debian/patches/series 2015-03-06 19:09:59.000000000 +0100 +++ nfs-utils-1.2.8/debian/patches/series 2015-03-12 09:01:37.000000000 +0100 @@ -15,4 +15,5 @@ 24-systemd-pipefs_in_run.patch 25-systemd-daemon-paths.patch 26-systemd-server-before-client.patch +27-systemd-enable-with-systemctl-statd.patch 90-gss-free-lucid-sec-context.patch diff -Nru nfs-utils-1.2.8/debian/rules nfs-utils-1.2.8/debian/rules --- nfs-utils-1.2.8/debian/rules 2015-03-06 07:45:34.000000000 +0100 +++ nfs-utils-1.2.8/debian/rules 2015-03-12 11:00:50.000000000 +0100 @@ -56,7 +56,7 @@ dh_installdocs -pnfs-common debian/README.Debian.nfsv4 dh_systemd_enable -p nfs-common nfs-client.target dh_systemd_enable -p nfs-kernel-server nfs-server.service - dh_installinit -pnfs-common --upstart-only -R --name statd + dh_installinit -pnfs-common --upstart-only --no-start -R --name statd dh_installinit -pnfs-common --upstart-only --no-start --name statd-mounting dh_installinit -pnfs-common --upstart-only -R --name gssd dh_installinit -pnfs-common --upstart-only --no-start --name gssd-mounting