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

Attachment: signature.asc
Description: PGP signature

Reply via email to