On 10/28/21 20:18, Carlos Eduardo wrote:
>> Using *s6-setuidgid* doesn't work for some scenarios, like automatically launching a screen session running rtorrent for a particular user.
>
> I've had similar problems and came to learn that plain s6-setuidgid
> doesn't set some variables that are relevant for user processes,
> especially your HOME directory, which might cause programs to try to
> load root's config files rather than yours.
>
> If that ends up being your problem, the simplest solution (and it
> doesn't require special support in s6) is adding the following lines
> to your rtorrent daemon (or, if you're using a setup like mine for
> user services, the user s6-svscan service, which will then propagate
> to all daemons running under it):
>
>> backtick HOME { homeof yourusername } export LOGNAME yourusername prog ...
>
> If you add your user service to the bundle that gets brought up upon
> system initialization (in Artix's case, default), it'll also run
> headless even before you even login (actually, making services only
> run on user login is more work than keeping them running at all
> times).
Yeap, I created my own service, and added to the default bundle (bad thing I remove my code since I thought that was just plain impossible)... I'll try your suggestion as soon as having some time to try it out. An yes, I was not finding any way for rtorrent to grab my ~/.rtorrent.rc, even by specifying it though the command to execute, hehe. Similar things happened with other screen sessions, but I can't remember all cases, just the last one I tried (rtorrent screen session).
It would be interesting to see if s6 itself can offer such functionality out of the box though, :)
Thanks a lot !
--
Javier
Received on Fri Oct 29 2021 - 04:23:39 CEST