Re: Shepherd should not reboot on exit when running as root

2022-02-06 Thread Arun Isaac

> Oops, fixed in 7c380590164ea8ee40de46059d07e08a48963577, thanks!

That's a neat solution. Thanks, Ludo!


signature.asc
Description: PGP signature


Re: Shepherd should not reboot on exit when running as root

2022-02-05 Thread Ludovic Courtès
Hello!

Arun Isaac  skribis:

> If shepherd is run as root, it assumes it is the init system and reboots
> the system. Since shepherd is not just an init system, but can also be
> used as a non-init process to manage other daemons, this is probably not
> good default behaviour. At the very least, it would be nice to have a
> command-line option to disable this behaviour.
>
> Just yesterday, I was tinkering with shepherd on a production server
> running Debian as the host system, and ended up accidentally rebooting
> it. Needless to say, I went through much pain and suffering! :-) I
> suppose I should count myself very lucky that it didn't halt the system!
> :-P

Oops, fixed in 7c380590164ea8ee40de46059d07e08a48963577, thanks!

Ludo’.



Shepherd should not reboot on exit when running as root

2022-01-26 Thread Arun Isaac

Hi,

If shepherd is run as root, it assumes it is the init system and reboots
the system. Since shepherd is not just an init system, but can also be
used as a non-init process to manage other daemons, this is probably not
good default behaviour. At the very least, it would be nice to have a
command-line option to disable this behaviour.

Just yesterday, I was tinkering with shepherd on a production server
running Debian as the host system, and ended up accidentally rebooting
it. Needless to say, I went through much pain and suffering! :-) I
suppose I should count myself very lucky that it didn't halt the system!
:-P

Here is the relevant piece of code in modules/shepherd.scm of the
shepherd source code.
--8<---cut here---start->8---
(define* (quit-exception-handler key #:optional value)
  "Handle the 'quit' exception, rebooting if we're running as root."
  (if (zero? (getuid))
  (begin
(local-output (l10n "Rebooting..."))
(reboot))
  (quit)))
--8<---cut here---end--->8---

Thanks!
Arun


signature.asc
Description: PGP signature