Re: How to reboot?
Andinus via beginners <[email protected]> Fri, 12 Jan 2024 21:39:23 +0530
| Newsgroups | gmane.comp.lang.perl.beginners |
|---|---|
| Message-ID | <[email protected]> |
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
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/