Re: Reading s6-rc database without root for completion

2022-11-10 Thread Laurent Bercot

I'd like for the user to be able to complete `sudo s6-rc -u change
some...` from a non-root terminal, but trying to use the output of
`s6-rc-db list services` fails as it can't take a lock in
/run/s6-rc/compiled.


 Hm, that's an oversight on my part. Reading the database should be
possible by normal users, but the lock is currently taken O_RDWR 
(because

the locking primitive is the same for reading and for writing), so
it fails. I will fix that.

 Until then, sure, read your info from the source directory, but be
aware it may not be in sync with the current live database.

 Thanks for the report!

--
 Laurent



Reading s6-rc database without root for completion

2022-11-09 Thread Carlos Eduardo
Writing a bash completion script for the s6-rc program, I'm stuck when
completing service names.

I'd like for the user to be able to complete `sudo s6-rc -u change
some...` from a non-root terminal, but trying to use the output of
`s6-rc-db list services` fails as it can't take a lock in
/run/s6-rc/compiled. While longruns can be sourced from the s6-svscan
directory, bundles, pipelines and oneshots can't.

Reading the source directory instead seems to be the simplest
solution, but is using the compiled definitions entirely out of the
question?