#1143778 runit: invoke-run verbosity cannot be controlled for user sessions

Package:
runit
Source:
runit
Description:
system-wide service supervision
Submitter:
Andrew Bower
Date:
2026-08-21 13:41:02 UTC
Severity:
normal
Tags:
#1143778#5
Date:
2026-08-06 07:55:35 UTC
From:
To:
When using runit-user-session, I cannot squelch verbose logging for a script
that wants to be run repeatedly because there is no user-controlled path
checked for this. Even if there were, the idiom would be unclear because does
one naturally want to override it on or off?

Another approach might be for an individual runscript to be able to do it when
it's not appropriate for that service, but that is not obviously how to
implement either.

(My example is mbsync from the isync package. I have not investigated
runit-cron-snooze but it would not be suitable for me because I do not wish to
replace proper cron!)

Minor issue.

Thanks!

#1143778#10
Date:
2026-08-07 20:42:28 UTC
From:
To:
Hi Andrew,

is this about "invoke-run: starting foo" message from
invoke-run or something else?
Do you have /etc/runit/verbose file? If so, invoke-run can be changed so
that a different path (inside /home/$user/) is tested for user services

for system-wide services the default is not verbose, one has to touch
the file to get the "invoke-run: starting foo" message

I don't know the isync package but, in case it helps, you can use
snooze + runit to get a "timer-like" service without the
runit-cron-snooze package.

Best,
Lorenzo

#1143778#15
Date:
2026-08-07 20:42:28 UTC
From:
To:
Hi Andrew,

is this about "invoke-run: starting foo" message from
invoke-run or something else?
Do you have /etc/runit/verbose file? If so, invoke-run can be changed so
that a different path (inside /home/$user/) is tested for user services

for system-wide services the default is not verbose, one has to touch
the file to get the "invoke-run: starting foo" message

I don't know the isync package but, in case it helps, you can use
snooze + runit to get a "timer-like" service without the
runit-cron-snooze package.

Best,
Lorenzo

#1143778#20
Date:
2026-08-14 07:17:46 UTC
From:
To:
ping

did I understand your issue, or it was something else?

if it's the invoke-run message, this patch could fix it
--- /lib/runit/invoke-run 2026-05-16 01:58:01.000000000 +0200 +++ /lib/runit/invoke-run-new 2026-08-14 09:07:51.911557587 +0200 @@ -91,17 +91,19 @@ fi fi
#1143778#29
Date:
2026-08-14 07:17:46 UTC
From:
To:
ping

did I understand your issue, or it was something else?

if it's the invoke-run message, this patch could fix it
--- /lib/runit/invoke-run 2026-05-16 01:58:01.000000000 +0200 +++ /lib/runit/invoke-run-new 2026-08-14 09:07:51.911557587 +0200 @@ -91,17 +91,19 @@ fi fi
#1143778#34
Date:
2026-08-14 15:46:42 UTC
From:
To:
Hi Lorenzo,

Sorry, have been on holiday!

This is exactly the issue, yes!

I'm not a big fan of the code dupliction there, I'd rather an RETC
variable were used to define the config directory, so the output could
be defined only once, and/or a helper function like is_verbose()
although also without duplicate user-service detection logic.

I also just noticed this:

  if [ "$(id -u)" -ge 1000 ] && [ -d /home/"$(id -u -n)" ] ; then

I don't think that's a sound way of detecting invocation for non-system
service. To understand if the user is a system user requires parsing
/etc/login.defs, UID_MIN may not be 1000. Is it enough to detect != 0?
Secondly, the home directory could be anywhere.

How about something like this?

  RETC=/etc/runit
  IFS=: read -r RUSER pw uid gid gecos home shell <<EOF
  $(getent passwd "$(id -u)" 2>/dev/null)
  EOF

  if [ "${uid:-0}" -ne 0 ] && [ -d "$home" ]; then
    RETC="$home"/.runit
  else
    unset RUSER
  fi
  unset pw uid gid gecos home shell

I think a various error cases get indirect detection here, so we can
keep it readable.

Then read "$RETC/verbose" to test verbosity. There may be other things
that could benefit from this snippet.

#1143778#39
Date:
2026-08-14 15:46:42 UTC
From:
To:
Hi Lorenzo,

Sorry, have been on holiday!

This is exactly the issue, yes!

I'm not a big fan of the code dupliction there, I'd rather an RETC
variable were used to define the config directory, so the output could
be defined only once, and/or a helper function like is_verbose()
although also without duplicate user-service detection logic.

I also just noticed this:

  if [ "$(id -u)" -ge 1000 ] && [ -d /home/"$(id -u -n)" ] ; then

I don't think that's a sound way of detecting invocation for non-system
service. To understand if the user is a system user requires parsing
/etc/login.defs, UID_MIN may not be 1000. Is it enough to detect != 0?
Secondly, the home directory could be anywhere.

How about something like this?

  RETC=/etc/runit
  IFS=: read -r RUSER pw uid gid gecos home shell <<EOF
  $(getent passwd "$(id -u)" 2>/dev/null)
  EOF

  if [ "${uid:-0}" -ne 0 ] && [ -d "$home" ]; then
    RETC="$home"/.runit
  else
    unset RUSER
  fi
  unset pw uid gid gecos home shell

I think a various error cases get indirect detection here, so we can
keep it readable.

Then read "$RETC/verbose" to test verbosity. There may be other things
that could benefit from this snippet.