Package: runit Followup-For: Bug #939971 > What is missing is documentation > ... > I think you want to source /etc/default/runit *before* > /etc/default/service.
updated patch is attached -- 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-34 runit suggests no packages. -- Configuration Files: /etc/runit/3 changed [not included] -- no debconf information -- debsums errors found: debsums: changed file /lib/runit/invoke-run (from runit package)
>From a758a4b40171aa087e8ca1b8025defd7463d6f5d Mon Sep 17 00:00:00 2001 From: Lorenzo Puliti <[email protected]> Date: Tue, 10 Sep 2019 16:31:53 +0200 Subject: [PATCH] invoke-run: add verbose option and export NAME Export `NAME` variable and add a `VERBOSE` option into invoke-run interpreter. Also add a runit default file for system wide setting about runit services. --- debian/contrib/lib/invoke-run | 8 ++++++++ debian/contrib/man/invoke-run.5 | 12 ++++++++++++ debian/runit.default | 4 ++++ 3 files changed, 24 insertions(+) create mode 100644 debian/runit.default diff --git a/debian/contrib/lib/invoke-run b/debian/contrib/lib/invoke-run index b3b0c55..2a11306 100755 --- a/debian/contrib/lib/invoke-run +++ b/debian/contrib/lib/invoke-run @@ -31,6 +31,8 @@ case "${runscript}" in esac readonly runscript service +export NAME=$service + if [ -f "/etc/sv/${service}/.meta/installed" ] ; then readonly installed="/usr/share/runit/meta/${service}/installed" # uninstalled, but not purged. See #929693 and commit [4c485b] @@ -41,6 +43,12 @@ if [ -f "/etc/sv/${service}/.meta/installed" ] ; then fi fi +if [ -r /etc/default/runit ]; then + set -a + . /etc/default/runit + set +a +fi + if [ -r "/etc/default/${service}" ] ; then # export all assigned variables, allow references to # undefined variables. diff --git a/debian/contrib/man/invoke-run.5 b/debian/contrib/man/invoke-run.5 index 4ea0523..51b06a5 100644 --- a/debian/contrib/man/invoke-run.5 +++ b/debian/contrib/man/invoke-run.5 @@ -44,6 +44,18 @@ introducing runscript. After that, shell interpret rest of runscript, with some additional environment set according following rules: .IP "" 4 +A +.BI NAME= foo +variable is exported. +.PP +.IP "" 4 +The +.BI /etc/default/runit +file is interpreted with +.I /bin/sh +and all variable assignment are accessible to runscript. +.PP +.IP "" 4 If file .BI /etc/default/ foo exists, it is interpreted with diff --git a/debian/runit.default b/debian/runit.default new file mode 100644 index 0000000..26d057e --- /dev/null +++ b/debian/runit.default @@ -0,0 +1,4 @@ +# system wide setting for runit services + +# print runsv messages about starting and stopping the service +VERBOSE=0 -- 2.23.0

