Date: Sat, 5 Apr 1997 17:00:16 +0400 (MSD) From: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru> To: FreeBSD-gnats-submit@freebsd.org Subject: bin/3202: shutdown(8) don't work if started from an X Window Manager menu Message-ID: <199704051300.RAA01324@tejblum.dnttm.rssi.ru> Resent-Message-ID: <199704051300.FAA06275@freefall.freebsd.org>
index | next in thread | raw e-mail
>Number: 3202
>Category: bin
>Synopsis: shutdown(8) don't work if started from an X Window Manager menu
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sat Apr 5 05:00:02 PST 1997
>Last-Modified:
>Originator: Dmitrij Tejblum
>Organization:
>Release: FreeBSD 3.0-CURRENT i386
>Environment:
I tried to start 'shutdown -h now' from my X Window Manager menu.
>Description:
reboot(8) thinks that it started from an interactive shell, and ignore
only SIGHUP.
It seems that somebody, (xdm ?), when die, kills reboot(8) with some other
signal.
>How-To-Repeat:
>Fix:
May be this is not the best way, but it is simple.
*** src/sbin/reboot/reboot.c.orig Sat Apr 5 16:23:20 1997
--- src/sbin/reboot/reboot.c Sat Apr 5 16:36:56 1997
***************
*** 130,137 ****
if (kill(1, SIGTSTP) == -1)
err("SIGTSTP init: %s", strerror(errno));
! /* Ignore the SIGHUP we get when our parent shell dies. */
! (void)signal(SIGHUP, SIG_IGN);
/* Send a SIGTERM first, a chance to save the buffers. */
if (kill(-1, SIGTERM) == -1)
--- 130,137 ----
if (kill(1, SIGTSTP) == -1)
err("SIGTSTP init: %s", strerror(errno));
! /* Avoid receiving signals from parent shell or other group leader */
! daemon(0,1);
/* Send a SIGTERM first, a chance to save the buffers. */
if (kill(-1, SIGTERM) == -1)
>Audit-Trail:
>Unformatted:
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704051300.RAA01324>
