Package: runit
Version: 2.1.2-35
Followup-For: Bug #942320

> Looks good to me, but does not apply:

Sorry, I somehow picked up the wrong branch.
New patch should be ok


-- 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)

Versions of packages runit depends on:
ii  libc6           2.29-2
ii  sysuser-helper  1.3.3

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

runit suggests no packages.

-- Configuration Files:
/etc/default/runit changed [not included]
/etc/runit/3 changed [not included]

-- no debconf information

-- debsums errors found:
debsums: changed file /lib/runit/invoke-run (from runit package)
debsums: changed file /sbin/update-service (from runit package)
>From fb4c08329b710b1bb276e9ecad561c16b63cb9fe Mon Sep 17 00:00:00 2001
From: Lorenzo Puliti <[email protected]>
Date: Thu, 24 Oct 2019 11:16:48 +0200
Subject: [PATCH 1/2] Use dot-symlink to mark a service as disabled

When removing a service with update-service, replace 'service'
with a '.service' symlink rather than removing the symlink.
This is done to preserve the local admin choice to disable a
service.

Closes: #942320
---
 debian/contrib/update-service   |  4 ++++
 debian/contrib/update-service.8 | 20 ++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/debian/contrib/update-service b/debian/contrib/update-service
index bb83f2b..f9553c2 100644
--- a/debian/contrib/update-service
+++ b/debian/contrib/update-service
@@ -83,6 +83,9 @@ case "$opt" in
         fi
       fi
     fi
+    if [ -d "$servicedir"/."$sv" ]; then
+        rm "$servicedir"/."$sv"
+    fi
     ln -s "$svdir" "$servicedir"/"$sv"
     printf '%s\n' "Service $sv added."
     exit 0
@@ -98,6 +101,7 @@ case "$opt" in
         test "$relsymdir"/"$sv" = "$(readlink "$servicedir"/"$sv")" ||
           fatal "$servicedir/$sv does not point to $svdir."
     rm -f "$servicedir"/"$sv"
+    ln -s "$svdir" "$servicedir"/."$sv"
     printf '%s %s\n' \
       "Service $sv removed," \
       "the service daemon received the TERM and CONT signals."
diff --git a/debian/contrib/update-service.8 b/debian/contrib/update-service.8
index a45e113..e8686a8 100644
--- a/debian/contrib/update-service.8
+++ b/debian/contrib/update-service.8
@@ -89,6 +89,26 @@ program to control the removed service, or query its status, 
e.g.:
 # sv status
 .I service-directory
 
+When the service directory
+.IR service-directory
+is removed, the service
+.I service-name
+will be marked as disabled by creating a
+.I .service-name
+symlink. This will prevent tools like
+.BR dh_runit (1)
+and runit-helper from auto-enabling
+.I service-name
+at install or upgrade of the package that ships
+.IR service-directory .
+The
+.I .service-name
+symlink will be removed as the
+.IR service-directory
+is added again to the system-wide service supervision or when the package that 
ships
+.IR service-directory
+is purged.
+
 .TP
 .B \--list | \-l
 If
-- 
2.24.0.rc0

Reply via email to