r/voidlinux • u/bvdeenen • Apr 12 '26
`sv status ...` without sudo.
Hi all. I'm thinking about adding runit service status to this kde project but I don't like the fact that you need root rights to look at the status of the running runit services.
What's the cleanest way to make it so that I can at least inspect the status of running services? Make /usr/bin/sv setuid? Do something with ACL's on /var/service? Other suggestions?
11
Upvotes
9
u/Ok-Tip-6972 Apr 12 '26
You can change the user and group ownership of the relevant files, this is the supported and expected solution. See https://smarden.org/runit/faq#user (but consider changing permissions of
okandstatusonly (withoutcontrol) if you don't want to give users the ability to fully manage services).I can't recall from the top of my head whether this solution is persistant across reboots. You'll have to try that.
5
u/eftepede Apr 12 '26
Per-user services exist and work fine.
1
u/bvdeenen Apr 15 '26
Ok, I've augmented the TuxManager project with
runitcapabilities using Claude. Worked on the first go, and took about 1 hour! The produced code looks pretty clean. I'm going to check on an Ubuntu instance if the systemd interaction still works, and then probably do a pull request.1
u/Boring-Ingenuity-828 Apr 12 '26
You maybe have a go with vsv
https://github.com/bahamas10/vsv
If I don't remember wrong it does not require sudo privileges to run
3
u/lukeflo-void Apr 12 '26
There is a reason that most service managers distinguish between system (root) and user services
2
u/bart9h Apr 12 '26
Why does
sv statusrequire root anyway?1
u/sanya567xxx Apr 12 '26 edited Apr 12 '26
use
vsv statusadd
vsv statusin sudo as something that is allowed to be called with root privileges for members of users group (or only yourself?) via NOPASSWD clause in /etc/sudoers (maybe /etc/sudoers.d would be cleaner)make alias to it or have a small shell script that, upon being called, executes just that command and prints the output.
The clause is such that if the command differs at all, it will require password. Also environment variables are not preserved unless you specifically allow them.
P.S. the author of vsv is awesome and his bash scripting tutorial on YT was very nice and pretty deep. his website: https://ysap.sh/
0
u/[deleted] Apr 13 '26
[deleted] — view deleted comment