control: tags -1 +confirmend +moreinfo
[2019-09-10 17:09] Lorenzo Puliti <lorenzo.r...@gmail.com> > Package: runit > Version: 2.1.2-34 > Severity: normal > Tags: patch > > Hi, > as discussed in #935958 it's inconvenient to print messages like > 'starting foo' or 'stopping foo' by default, as they are written to > the service log. > > The attached patch does the following: > * add support for a VERBOSE option to invoke run: the > value is sourced from /etc/default/runit file > (off by default) and can be overridden for each service > placing a file in /etc/sv/<service>/conf/ > > * export the NAME variable in invoke-run > > * add a system-wide file to be sourced for runit services > > the verbose option should be tested in runscripts like > > if [ "$VERBOSE" = 1 ]; then > echo "runsv: starting $NAME..." > fi > > I'm not sure using /etc/default path (rather than /etc/runit) is > appropriate; file there are usually meant for daemons but there are > exceptions (I have a Grub directory there). I think /etc/default it is fine. What is missing is documentation. invoke-run(5) should mention that NAME is exported and /etc/default/runit is sourced. > debsums: changed file /lib/runit/invoke-run (from runit package) > part 2 text/plain 1579 > >From 354706b5eac44d35814eb584c1b0272995f441ff Mon Sep 17 00:00:00 2001 > From: Lorenzo Puliti <lorenzo.r...@gmail.com> > Date: Tue, 10 Sep 2019 16:31:53 +0200 > Subject: [PATCH] invoke-run: add verbose option and export NAME > [...] > diff --git a/debian/contrib/lib/invoke-run b/debian/contrib/lib/invoke-run > index b3b0c55..b0f6ef6 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] > @@ -49,6 +51,12 @@ if [ -r "/etc/default/${service}" ] ; then > set +a -u > fi > > +if [ -r /etc/default/runit ]; then > + set -a > + . /etc/default/runit > + set +a > +fi I think you want to source /etc/default/runit *before* /etc/default/service. -- Note, that I send and fetch email in batch, once in a few days. Please, mention in body of your reply when you add or remove recepients.