Reboot won't

YONETANI Tomokazu y0n3t4n1 at gmail.com
Thu Oct 23 06:28:35 PDT 2014


Hi.

On one of my DragonFly BSD boxes (it's an AMD Opteron 3280, in case
it matters), the reboot command won't reboot the system, but leaves
the system inaccessible from the console or from the network.  It's
been this way for than a few months, but I don't remember if I
had this problem last year.  I took a closer look at the problem
and found:
- `shutdown -r now' works as expected, as well as `kill -INT 1'
- even after reboot command failed, CTRL+ALT+DEL or CTRL+ALT+ESC
  still works, and the former can reboot the system.

So I suspected that it was reboot command itself, and I spotted
that it's killed by kill(-1, SIGTERM); if fact, if I added the
following change and I can restart the system with reboot command
again:

diff --git a/sbin/reboot/reboot.c b/sbin/reboot/reboot.c
index 6891027..04556eb 100644
--- a/sbin/reboot/reboot.c
+++ b/sbin/reboot/reboot.c
@@ -148,6 +148,8 @@ main(int argc, char *argv[])
 	/* Ignore the SIGHUP we get when our parent shell dies. */
 	signal(SIGHUP, SIG_IGN);
 
+	signal(SIGTERM, SIG_IGN);
+
 	/* Send a SIGTERM first, a chance to save the buffers. */
 	if (kill(-1, SIGTERM) == -1)
 		err(1, "SIGTERM processes");

However, this tiny piece of code hasn't greatly changed since the
epoch of DragonFly BSD, so there may have been some non-trivial changes
to the way signals are handled recently (or this year).

Best Regards,
YONETANI Tomokazu.



More information about the Users mailing list