Package: runit
Version: 2.1.2-48
Severity: normal
X-Debbugs-Cc: plore...@disroot.org

Maintscript run unconditionally sysv script during packages 
install/remove/upgrade:
this is ok when a correspondant runscript does not exist (runit uses sysv 
script as
fallback in that case) but it creates several issues when a native runscripts 
exists.

* one can end up with tho instances of the same services, and one is 
unsupervised
* the sysv instance may clash with the runit one, runit usually wins but in the 
meanwhile
  the package upgrade may fail to configure (for example mariadb) and the 
running instance
  may crash
* the two instances may also interact in unspected ways without crashing

Several solution exists but it's not obvious to me what's the right one:

A. divert or override in some way update-rc.d and invoke-rc.d form i-s-h package
B. abuse the policy-rc.d hack to run the action instead of denying it
C. divert /etc/init.d/foo and replace it with a symlink to /usr/bin/sv
D. hijack lsb init functions like /lib/lsb/init-functions.d/40-systemd
E. use a start-stop-daemon wrapper

All the above have the problem that are limited to sysv script, so it's not 
possible
to access to a systemd socket/path/timer service, but that's probably a 
separate problem.
All of the above interact badly with invoke-run, when it call '/etc/init.d/foo 
stop' the
runit service enters a loop where it down itself..

Other disadvantages:

A.1. no hope to merge into i-s-h package, discussion with patches is stuck 
since 2019, see #924132
     and discussion on salsa MR. So I'll have to maintain a runit version of 
the two helpers forever
  2. overrride or divert of essential bin, which can break package install, see 
#986644

B.1. old and somehow obscure interface, it probably should be handled with 
alternatives..
  2. running the action is outside the scope of the interface, as it should 
just allow or deny an
     action by return an appropriate code, but is not supposed to run the 
replacement directly

C.1  insserv complains with four line of warning for each diverted scripts 
during upgrades
  2. insserv ignores the diverted scripts which has the LSB header, so it no 
longer consider
     the script when it sets the start order of scripts 

D.1. doesn't work on initscripts that do not include lsb init functions, not 
sure how many
     are there
  2. one need to be carefull to not pollute sysvscript namespace when a 
runscript does not exists
  3. if a sysv script is written in some wierd/unexpected way, not sure who 
knows what happens..

E.1. uses zsh
  2. overrride or divert of essential bin
  3. are there sysv scripts that do not use start-stop-daemon (except 
'oneshots')?
  4. what if start-stop-daemon changes the interface (very very unlikely)

Overall E and D seem far better than A, B and C, in term of risk and 
maintainance burden required;
D may be slightly better than E (mainly because of E1 and E2) but I'm unsure of 
consequence of
D2 and D3.
It is probably worth to experiment with both, I think I'm going to enable D and 
provide a
way to disable it so that E is still usable.




-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
merged-usr: no
Architecture: amd64 (x86_64)

Kernel: Linux 5.7.0-1-amd64 (SMP w/4 CPU threads)
Kernel taint flags: TAINT_FIRMWARE_WORKAROUND, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /bin/dash
Init: runit (via /run/runit.stopit)
LSM: AppArmor: enabled

Versions of packages runit depends on:
ii  libc6           2.34-8
ii  runit-helper    2.14.2
ii  sysuser-helper  1.3.7+really1.4.1

Versions of packages runit recommends:
ii  runit-init  2.1.2-48

Versions of packages runit suggests:
ii  socklog  2.1.0+repack-4+b1
pn  zsh      <none>

-- Configuration Files:
/etc/default/runit changed [not included]
/etc/runit/ctrlaltdel changed [not included]
/etc/runit/runsvdir/single/sulogin/run [Errno 2] No such file or directory: 
'/etc/runit/runsvdir/single/sulogin/run'

-- no debconf information

-- debsums errors found:
debsums: changed file /lib/lsb/init-functions.d/40-runit (from runit package)
debsums: changed file /lib/runit/trigger_sv (from runit package)

Reply via email to