[artix-general] [s6] starting oneshots as non root

Javier je-vv at e.email
Tue Aug 10 02:06:30 CEST 2021


On 8/9/21 5:17 PM, Dudemanguy wrote:
> If you want to run a command as a certain user, you can use the
> s6-setuidgid program which is designed for this. I see you are calling
> screen in this script though so I would not expect that to work unless
> you are actually logged in.

Ohh, screen is a must.  I don't use the rtorrent daemon, since I don't use xmlrpc front ends, I just use the rtorrent ncurses UI, which I can even access remotely through ssh.

So I guess no way to get rtorrent working as a oneshot, :(  BTW, I couldn't get it to work as a longrun at all, since "s6-rc -d change" never got to kill when started once logged in (even specifying the signal number on "finish"), so I moved to oneshot...

But to make sure on "s6-setuidgid" usage [1], I can just use it as "exec" for example, like using:

> s6-setuidgid <owner>:<primary_group> <cmd> <cmd_args>

Instead of:

> exec <cmd> <cmd_args>

Where <cmd> is an actual executable...

Out of curiosity, why wouldn't screen be called without being logged in?  The screen sockets are not stored under "/run/user/<gid>".  They are stored, even the non root ones, under "/run/screens/S-<username>", so I would have guessed there was no issue with the sockets getting lost under "/run/user/<gid>", or not even created there.

@dudemanguy, do you happen to know if the systemd root launching as user feature (not the user launch upon login, which can easily be achieved with a shell profile) is to come to s6?  Or runit for that matter?  Like:  "/etc/systemd/system/<service>@.service" on systemd?  Those services don't require user login, and are pretty handy if calling screen from a root service doesn't work for example...

Ohh well, I guess the need to be actually "logged in" might come from logind, which is becoming really a pain for several use cases of mine, :(  I guess there's no way to get artix working without elogind, since it's so basic for artix, :(.

-- 
Javier

[1]  https://skarnet.org/software/s6/s6-setuidgid.html

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 228 bytes
Desc: OpenPGP digital signature
URL: <https://lists.artixlinux.org/archives/artix-general/attachments/20210809/dd52bb4a/attachment.sig>


More information about the artix-general mailing list