On Fri, 2024-01-12 at 21:39 +0530, Andinus via beginners wrote:
> hw @ 2024-01-12 14:16 +01:
>
> > But how can I reboot/restart the computer from the xmpp client? I
> > don't want the xmpp client to run as root all the time. I would use
> > something like
> >
> >
> > system('shutdown', '-r', 'now');
> >
> >
> > in the xmpp client, and that does require root privileges. To make
> > things more complicated, systemd will probably interfere in some ways,
> > and selinux also may get in the way. So how I can do that?
>
> If you use `sudo` then you can setup a rule to allow the user to run the
> command `shutdown` as root.
>
> Example config for `doas`:
>
> /etc/doas.conf:
> permit nopass xmppuser cmd /sbin/shutdown args -r now
>
Thanks, I thought about sudo and figured it needs a password being
entered. If that works without, I'll start programming and test if
something else gets in the way :)
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/