Your message dated Sat, 14 Mar 2020 13:23:16 +0000
with message-id <[email protected]>
and subject line Bug#942323: fixed in dh-runit 2.8.15
has caused the Debian Bug report #942323,
regarding runit-helper: Use dot-symlinks to mark a service as disable
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
942323: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=942323
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: runit-helper
Version: 2.8.14
Severity: normal
Tags: patch

Hi,

there is a problem in runit-helper with the following logic

postinst () {
        local action="${1}" previous="${2:-}"

        # Fresh installation (not upgrade). It is important to not override
        # local admin decision (see #899242).
        if [ "${ENABLE}" = yes ] && \
                dpkg --compare-versions "${previous}" '<<' "${SINCE}" ; then
                ln -sf "/etc/sv/$NAME" "/etc/runit/runsvdir/default/$NAME"
        fi

...

postrm () {
        local action="${1}"

        if [ "${action}" != 'purge' ] && [ "${action}" != 'remove' ] ; then
            return
        fi

        # Links in other runsvdirs is responsibility of administrator.
        rm -f "/etc/runit/runsvdir/default/$NAME"

...

if I remove (without purging) a package with version >= SINCE and then I 
reinstall
such package, runit-helper will not enable the service. This is unexpected, 
since
the local admin never tell that he/she wants to keep the service disabled 
(and currently has no mean to do that).
I propose to use .service symlinks to mark a service as disabled (directories 
starting with
dots are ignored, this is already documented in runsvdir(8) manpage).
I've documented this in update-service manpage (see #942320); maybe this need 
also a
'POLICY' section in dh_runit(1) or a notice to users of runit on upgrade?

Lorenzo 


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

Kernel: Linux 4.20.3-van (SMP w/4 CPU cores; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: runit (via /run/runit.stopit)

-- no debconf information

-- debsums errors found:
debsums: changed file /lib/runit-helper/runit-helper (from runit-helper package)
>From 66b2ba56358d2742704f8108c338d2ec29d5e76a Mon Sep 17 00:00:00 2001
From: Lorenzo Puliti <[email protected]>
Date: Thu, 10 Oct 2019 23:54:53 +0200
Subject: [PATCH] Use .link to mark a service as disabled

Use '.link' instead of removing 'link' to disable a service.
This allow to preserve local admin choice to disable a
service both on package upgrade and when the package is removed
but not purged.
---
 runit-helper | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/runit-helper b/runit-helper
index 70c42f2..4d4970a 100755
--- a/runit-helper
+++ b/runit-helper
@@ -21,13 +21,14 @@ set -e
 postinst () {
        local action="${1}" previous="${2:-}"
 
-       # Fresh installation (not upgrade). It is important to not override
-       # local admin decision (see #899242).
+       # It is important to not override local admin
+       # decision (see #899242).
        if [ "${ENABLE}" = yes ] && \
-               dpkg --compare-versions "${previous}" '<<' "${SINCE}" ; then
+               [ ! -h "/etc/runit/runsvdir/default/.$NAME" ] ; then
                ln -sf "/etc/sv/$NAME" "/etc/runit/runsvdir/default/$NAME"
        fi
-
+        # "ENABLE=no" is always a no-op
+        
        # Upgrade will changes destination of /etc/sv/{name}/supervise symlink 
from
        # /var/* to /run/*. If service was running, it important that its 
supervise
        # directory is still accessible via /etc/sv/{name}/supervise symlink.
@@ -56,8 +57,12 @@ postrm () {
            return
        fi
 
+       # When "ENABLE=no" the $NAME link is an admin decision
+       # so we don't remove it.
        # Links in other runsvdirs is responsibility of administrator.
-       rm -f "/etc/runit/runsvdir/default/$NAME"
+       if [ "${action}" = 'remove' ] && [ "${ENABLE}" = yes ] ; then
+            rm -f "/etc/runit/runsvdir/default/$NAME"
+        fi
 
        # If runscript was never invoked, there will be no files
        # in this directory, and `dpkg' will remove it. In this case,
@@ -84,6 +89,8 @@ postrm () {
                fi
        done
        if [ "${action}" = 'purge' ] ; then
+            rm -f "/etc/runit/runsvdir/default/$NAME"
+            rm -f "/etc/runit/runsvdir/default/.$NAME"
             logdir="/var/log/runit/$NAME"
            if [ -d "$logdir" ] ; then
                 rm -r "$logdir"
-- 
2.23.0


--- End Message ---
--- Begin Message ---
Source: dh-runit
Source-Version: 2.8.15
Done: Lorenzo Puliti <[email protected]>

We believe that the bug you reported is fixed in the latest version of
dh-runit, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Lorenzo Puliti <[email protected]> (supplier of updated dh-runit package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Thu, 27 Feb 2020 19:01:26 +0100
Source: dh-runit
Architecture: source
Version: 2.8.15
Distribution: unstable
Urgency: medium
Maintainer: Lorenzo Puliti <[email protected]>
Changed-By: Lorenzo Puliti <[email protected]>
Closes: 939631 941924 942323
Changes:
 dh-runit (2.8.15) unstable; urgency=medium
 .
   [ Dmitry Bogatov ]
   * Make dh-runit Multi-Arch: foreign (Closes: #939631)
 .
   [ Lorenzo Puliti ]
   * Remove log dir on purge (Closes: #941924)
   * Use .link to mark a service as disabled (Closes: #942323)
   * Adopt dh-runit package
   * Revert "Temporary disable testsuite due build-dependency transition"
   * Bump Standards Version to 4.5.0
     - use '_runit-log' user in logscripts instead of 'runit-log'
     - breaks and conflicts with runit << 2.1.2-36
Checksums-Sha1:
 9de5575174ce4ac8c5cebd84ab05c8d70fb9bc38 1786 dh-runit_2.8.15.dsc
 ba38051ec582cc9d38175da69cded932eaff0b7e 16340 dh-runit_2.8.15.tar.xz
 a3d4a98cf2ff679d4906657c50ffa4bf4ec132bc 6202 dh-runit_2.8.15_source.buildinfo
Checksums-Sha256:
 c4bdf3d9e5277340bec18d61d93c2c6efb14a688b4320b2208298e063343c298 1786 
dh-runit_2.8.15.dsc
 c5aa7d49e95ef242bde8c5a5dde295723e6a0b112370dae3b455b1d869b587df 16340 
dh-runit_2.8.15.tar.xz
 0acfdab6e47caed80728f34216084283560f37b4a359fa93ff9b99f7ac700405 6202 
dh-runit_2.8.15_source.buildinfo
Files:
 b4494f73776702f9994f09c13bd99820 1786 admin optional dh-runit_2.8.15.dsc
 8aa14c6471889e85ee38359b8264db64 16340 admin optional dh-runit_2.8.15.tar.xz
 39494b7bea099fde991e296c57c2b081 6202 admin optional 
dh-runit_2.8.15_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEkjZVexcMh/iCHArDweDZLphvfH4FAl5s1cYACgkQweDZLphv
fH6TAhAAtUnetVD6MK6cJJIH/ZtxglxoPToDmSIBa0rlhFTVREEdZOdir91gYeHR
xyk9aylw/vmU7IbfjJ4cAPv0lcBSGqu3BfhNSp/wbaTaSTXS27p6y8lgPBg9Cdsn
ny0ishI/zMuXtWwgOPrWlRE6uXZFdSugnX4kZDs3iOg8rQbfGriAfqNf1AtA/v8+
yEZEpUo1YBAlNDYlWNQx/bUePqNMU22Q+nSZIRRDS0ah6qLnq8fyJ5+kEGBsvMu7
YuEbxVlGGgzQIaD6twCg/rN81JYPYCJUcWOmPQj2UGOk058QqvssgfxgHhIHqPN6
lp4sMkuIuqX7fE2isI1fGAlFWSXW3hhiJ0iLNzGo9YYkxP7+f0Vx0//AfXd/5Gov
FbtmOgmOKtLxz0t/CUOQ0YVVpUrDzUdNkAKxEk21sxGnfcr6S6smtnSlpd18Uu1p
/67IN1m0soaTuPROxmjzvs8Tt/maubsP016mTC8uwOwc2MvrUSfnnyhqPicy0be3
f2yy9y+tP/qP0kK24l9XObEYoHd5S/NkR38oib14hL+iKxlKVMffR1lL71mgLAec
cVR/uIuNFLp8PtF0tlusNf00jnu14xzydqAlfyzWRor6F6anbLRDpn5hq9dFRqrN
D1OGWUBLLoRF98TVpK6ETobZ98WoC3kIoiTfYCc2MeJu871xX7Q=
=5q/a
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to