On Sat 07 Sep 2019 19:47:39 +0000, Dmitry Bogatov wrote:
>> I think it'd be worthwhile to come up with a slightly more
>> sophisticated mechanism for populating runit configuration on systems
>> that actually need such configuration, while also eliminating noise on
>> systems that don't need it.
>
> This configuration system already exists, and is not tied to runit in
> any way. It is called `dpkg --exclude`. So much on unwanted /etc/*
> files.
Personally I am OK with either
"downgrade Depends: runit-helper to Recommends: runit-helper" or
"merge runit-helper into init-system-helpers".
*I* don't care about a few extra files in /etc.
For the record,
here's exactly how to do the dpkg excludes Dmitry mentioned.
On a full system, put this into /etc/dpkg/dpkg.cfg:
path-exclude=/etc/sv
path-exclude=/etc/sv/*
path-exclude=/etc/runit
path-exclude=/etc/runit/*
Before:
bash5$ mmdebstrap forky /dev/null --quiet --include=openssh-server \
--customize-hook='env --chdir $1 find etc/ -path "*sv*" -ls ,
-path "*runit*" -ls'
316703 0 drwxr-xr-x 3 root root 60 Sep 3 12:35
etc/sv
316704 0 drwxr-xr-x 4 root root 120 Sep 3 12:35
etc/sv/ssh
316710 4 -rwxr-xr-x 1 root root 393 Aug 24 02:39
etc/sv/ssh/run
316707 4 -rwxr-xr-x 1 root root 470 Aug 24 02:39
etc/sv/ssh/finish
316708 0 drwxr-xr-x 2 root root 60 Sep 3 12:35
etc/sv/ssh/log
316709 4 -rwxr-xr-x 1 root root 140 Aug 24 02:39
etc/sv/ssh/log/run
316705 0 drwxr-xr-x 2 root root 60 Sep 3 12:35
etc/sv/ssh/.meta
316706 0 -rw-r--r-- 1 root root 0 Aug 24 02:39
etc/sv/ssh/.meta/installed
316698 0 drwxr-xr-x 3 root root 60 Sep 3 12:35
etc/runit
316699 0 drwxr-xr-x 3 root root 60 Sep 3 12:35
etc/runit/runsvdir
316699 0 drwxr-xr-x 3 root root 60 Sep 3 12:35
etc/runit/runsvdir
316700 0 drwxr-xr-x 2 root root 40 Aug 24 02:39
etc/runit/runsvdir/default
316700 0 drwxr-xr-x 2 root root 40 Aug 24 02:39
etc/runit/runsvdir/default
306840 4 -rw-r--r-- 1 root root 367 Jul 1 14:45
etc/bindresvport.blacklist
317112 0 lrwxrwxrwx 1 root root 31 Jul 27 20:11
etc/alternatives/view.sv.1.gz -> /usr/share/man/sv/man1/vim.1.gz
317089 0 lrwxrwxrwx 1 root root 31 Jul 27 20:11
etc/alternatives/vi.sv.1.gz -> /usr/share/man/sv/man1/vim.1.gz
317063 0 lrwxrwxrwx 1 root root 31 Jul 27 20:11
etc/alternatives/ex.sv.1.gz -> /usr/share/man/sv/man1/vim.1.gz
After:
bash5$ mmdebstrap forky /dev/null --quiet --include=openssh-server \
--customize-hook='env --chdir $1 find etc/ -path "*sv*" -ls ,
-path "*runit*" -ls' \
--dpkgopt='
path-exclude=/etc/sv
path-exclude=/etc/sv/*
path-exclude=/etc/runit
path-exclude=/etc/runit/*'
320929 4 -rw-r--r-- 1 root root 367 Jul 1 14:45
etc/bindresvport.blacklist
331190 0 lrwxrwxrwx 1 root root 31 Jul 27 20:11
etc/alternatives/view.sv.1.gz -> /usr/share/man/sv/man1/vim.1.gz
331167 0 lrwxrwxrwx 1 root root 31 Jul 27 20:11
etc/alternatives/vi.sv.1.gz -> /usr/share/man/sv/man1/vim.1.gz
331141 0 lrwxrwxrwx 1 root root 31 Jul 27 20:11
etc/alternatives/ex.sv.1.gz -> /usr/share/man/sv/man1/vim.1.gz
You have to do the both subdir glob and the dir, or dpkg itself gets upset.
For a more complicated real-world example, see package "localepurge".
Many postinsts break if you path-exclude aggressively, but runit-helper seems
OK.
I think maintainers are NOT REQUIRED to handle sysadmins doing arbitrary
path-excludes.
I think maintainers are REQUIRED to handle sysadmins doing a few specific
path-excludes, like /usr/share/doc/*.
I could not find a citation in https://salsa.debian.org/dbnpolicy/policy :-(
Packages installed before dpkg.cfg are edited don't "see" the exclusion
immediately.
You have to reinstall/upgrade the packages.
There is a quality-of-life bug to fix this:
https://bugs.debian.org/603700