Hi Lorenzo,
On Fri, Aug 14, 2026 at 09:17:46AM +0200, lorenzo wrote:
> Control: tags -1 moreinfo
> Control: tags -1 patch
>
> ping
Sorry, have been on holiday!
> > 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
>
> did I understand your issue, or it was something else?
This is exactly the issue, yes!
> if it's the invoke-run message, this patch could fix it
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.