Bug#923485: initscripts: Please make /etc/rc.local a conffile
control: tags -1 +confirmed control: reopen -1 control: retitle -1 upgrade sid->experimental modifies conffile [2019-04-10 11:55] Andreas Beckmann > Followup-For: Bug #923485 > Control: found -1 2.94-2 > > Hi, > > now piuparts complains about a modified conffile on upgrades from sid to > experimental. > > You need to compare /etc/rc.local.dpkg-old against all known md5sums of > variants previously installed by some package version, and delete it if > it matches one of them, s.t. it is "upgraded to the new version". > Only preserve the old one if it obviously contains user modifications. Any suggestions how can I make list of /all/ known md5sums? Or, wait, isn't md5sum of file installed by version in testing (which is going to be Buster) is enough? > >From the piuparts output: > > Setting up insserv (1.18.0-2) ... > insserv: FATAL: service mountdevsubfs has to exists for service hwclock > insserv: exiting now! Wierd. mountdevsubfs is dependency of hwclock, true, but why would it be missing? $ dpkg -S /etc/init.d/mountdevsubfs.sh initscripts: /etc/init.d/mountdevsubfs.sh $ apt-cache policy initscripts initscripts: Installed: 2.94-2 Candidate: 2.94-2 Version table: *** 2.94-2 100 1 http://cdn-fastly.deb.debian.org/debian experimental/main amd64 Packages 100 /var/lib/dpkg/status 2.93-8 500 500 http://cdn-fastly.deb.debian.org/debian testing/main amd64 Packages 500 http://cdn-fastly.deb.debian.org/debian sid/main amd64 Packages 2.91-1+devuan1.2 100 100 http://packages.devuan.org/devuan experimental/main amd64 Packages -- Note, that I send and fetch email in batch, once every 24 hours. If matter is urgent, try https://t.me/kaction --
Bug#923485: initscripts: Please make /etc/rc.local a conffile
Followup-For: Bug #923485 Control: found -1 2.94-2 Hi, now piuparts complains about a modified conffile on upgrades from sid to experimental. You need to compare /etc/rc.local.dpkg-old against all known md5sums of variants previously installed by some package version, and delete it if it matches one of them, s.t. it is "upgraded to the new version". Only preserve the old one if it obviously contains user modifications. >From the piuparts output: Setting up insserv (1.18.0-2) ... insserv: FATAL: service mountdevsubfs has to exists for service hwclock insserv: exiting now! could this be related to initscripts, too? That's the actual failure: 0m40.8s ERROR: FAIL: debsums reports modifications inside the chroot: /etc/rc.local Andreas
Bug#923485: initscripts: Please make /etc/rc.local a conffile
> +# This script is executed at the end of each multiuser runlevel. > +# Make sure that the script will "exit 0" on success or any other > +# value on error. > +# > +# In order to enable or disable this script just change the execution > +# bits. > + > +[ -d /etc/boot.d ] && run-parts /etc/boot.d Without the `exit 0` at the end anymore now that will return a failure by default. -- Pierre Ynard
Bug#923485: initscripts: Please make /etc/rc.local a conffile
[2019-02-28 21:41] Pierre Ynard > /etc/rc.local is currently installed from a static heredoc in > initscripts.postinst. This isn't very clean, and also old systems don't > benefit from new file versions on upgrades, and nothing handles its > removal on uninstall. > > Please consider making /etc/rc.local a conffile instead. It proved to be slightly more involved then I expected. If I just make default /etc/rc.local part of package, dpkg will silently overwrite already existing /etc/rc.local. To fix it, I had to move existing /etc/rc.local to temporary file in preinst and move back in postinst. If anybody knows how to push this work on some existing tool, suggestions are welcome. From c241125c29c5103e3aa914160f892c024df3e953 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Fri, 1 Mar 2019 10:39:33 + Subject: [PATCH] Make /etc/rc.local conffile (Closes: #923485) --- debian/initscripts.postinst | 4 debian/initscripts.preinst | 10 +- debian/src/initscripts/Makefile | 1 + debian/src/initscripts/etc/rc.local | 12 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 debian/src/initscripts/etc/rc.local diff --git a/debian/initscripts.postinst b/debian/initscripts.postinst index ad0eb4d0..1b23e3aa 100755 --- a/debian/initscripts.postinst +++ b/debian/initscripts.postinst @@ -18,6 +18,10 @@ case "$1" in ;; esac +if [ -f /etc/rc.local.dpkg-old ] ; then + mv /etc/rc.local.dpkg-old /etc/rc.local +fi + umask 022 # In 2.88dsf-23 the "mountoverflowtmp" script was dropped entirely. diff --git a/debian/initscripts.preinst b/debian/initscripts.preinst index 6c11ca13..698be29a 100755 --- a/debian/initscripts.preinst +++ b/debian/initscripts.preinst @@ -49,4 +49,12 @@ esac #DEBHELPER# -: +case $1 in +(install|upgrade) + if dpkg --compare-versions "$2" lt '2.94-2' ; then + if [ -f /etc/rc.local ] ; then + mv /etc/rc.local /etc/rc.local.dpkg-old + fi + fi + ;; +esac diff --git a/debian/src/initscripts/Makefile b/debian/src/initscripts/Makefile index 995ac89c..79294915 100644 --- a/debian/src/initscripts/Makefile +++ b/debian/src/initscripts/Makefile @@ -27,6 +27,7 @@ install: find $(DESTDIR)/lib -type d -name .svn -print0 |xargs -r0 rm -r chmod 755 $(DESTDIR)$(sysconfdir)/init.d/[a-z]* chmod 755 $(DESTDIR)$(sysconfdir)/network/if-up.d/[a-z]* + chmod 755 $(DESTDIR)$(sysconfdir)/rc.local chmod 644 $(DESTDIR)/lib/init/*.sh chmod -R g-w $(DESTDIR) chown -R root:root $(DESTDIR) diff --git a/debian/src/initscripts/etc/rc.local b/debian/src/initscripts/etc/rc.local new file mode 100644 index ..972c0672 --- /dev/null +++ b/debian/src/initscripts/etc/rc.local @@ -0,0 +1,12 @@ +#!/bin/sh -e +# +# rc.local +# +# This script is executed at the end of each multiuser runlevel. +# Make sure that the script will "exit 0" on success or any other +# value on error. +# +# In order to enable or disable this script just change the execution +# bits. + +[ -d /etc/boot.d ] && run-parts /etc/boot.d -- Note, that I send and fetch email in batch, once every 24 hours. If matter is urgent, try https://t.me/kaction --
Bug#923485: initscripts: Please make /etc/rc.local a conffile
Package: initscripts Version: 2.93-8 Severity: wishlist Dear Maintainer, /etc/rc.local is currently installed from a static heredoc in initscripts.postinst. This isn't very clean, and also old systems don't benefit from new file versions on upgrades, and nothing handles its removal on uninstall. Please consider making /etc/rc.local a conffile instead. Thanks, -- System Information: Debian Release: buster/sid APT prefers unstable APT policy: (500, 'unstable') Architecture: amd64 (x86_64) Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: sysvinit (via /sbin/init) Versions of packages initscripts depends on: ii coreutils 8.30-1 ii debianutils 4.8.6.1 ii lsb-base10.2018112800 ii mount 2.33.1-0.1 ii sysv-rc 2.93-8 ii sysvinit-utils 2.93-8 Versions of packages initscripts recommends: ii e2fsprogs 1.44.5-1 ii psmisc 23.2-1 initscripts suggests no packages. -- Configuration Files: /etc/default/rcS changed [not included] /etc/default/tmpfs changed [not included] -- no debconf information