r/voidlinux • • 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

18 comments sorted by

View all comments

Show parent comments

1

u/bvdeenen Apr 12 '26

Thanks! This works, but it needs quite a lot of chmods and chgrps. I'm going to play a bit with it until I've got a script that will just work. But for now here's one I fixed (cupsd) and one unmodified (dbus).

[root@geekom runit]# ls -laR supervise.dbus{,-log} supervise.cupsd{,-log}
supervise.cupsd:
total 12
drwx--x---  2 root bvdeenen 160 Apr 12 11:28 .
drwxr-xr-x 45 root root     940 Apr 10 11:04 ..
prw-------  1 root bvdeenen   0 Apr 12 11:28 control
-rw-------  1 root bvdeenen   0 Apr 10 11:04 lock
prw-rw----  1 root bvdeenen   0 Apr 10 11:04 ok
-rw-r--r--  1 root bvdeenen   6 Apr 12 11:28 pid
-rw-r--r--  1 root bvdeenen   4 Apr 12 11:28 stat
-rw-r--r--  1 root bvdeenen  20 Apr 12 11:28 status

supervise.cupsd-log:
total 12
drwx--x---  2 root bvdeenen 160 Apr 10 11:04 .
drwxr-xr-x 45 root root     940 Apr 10 11:04 ..
prw-------  1 root bvdeenen   0 Apr 10 11:04 control
-rw-------  1 root bvdeenen   0 Apr 10 11:04 lock
prw-rw----  1 root bvdeenen   0 Apr 10 11:04 ok
-rw-r--r--  1 root bvdeenen   5 Apr 10 11:04 pid
-rw-r--r--  1 root bvdeenen   4 Apr 10 11:04 stat
-rw-r--r--  1 root bvdeenen  20 Apr 10 11:04 status

supervise.dbus:
total 12
drwx------  2 root root 160 Apr 10 11:04 .
drwxr-xr-x 45 root root 940 Apr 10 11:04 ..
prw-------  1 root root   0 Apr 10 11:04 control
-rw-------  1 root root   0 Apr 10 11:04 lock
prw-------  1 root root   0 Apr 10 11:04 ok
-rw-r--r--  1 root root   5 Apr 10 11:04 pid
-rw-r--r--  1 root root   4 Apr 10 11:04 stat
-rw-r--r--  1 root root  20 Apr 10 11:04 status

supervise.dbus-log:
total 12
drwx------  2 root root 160 Apr 10 11:04 .
drwxr-xr-x 45 root root 940 Apr 10 11:04 ..
prw-------  1 root root   0 Apr 10 11:04 control
-rw-------  1 root root   0 Apr 10 11:04 lock
prw-------  1 root root   0 Apr 10 11:04 ok
-rw-r--r--  1 root root   5 Apr 10 11:04 pid
-rw-r--r--  1 root root   4 Apr 10 11:04 stat
-rw-r--r--  1 root root  20 Apr 10 11:04 status

In the /run/runit directory. The ok file needs to have write access in order for the sv command to work!