From owner-freebsd-bugs Sat Apr 5 05:00:07 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id FAA06303 for bugs-outgoing; Sat, 5 Apr 1997 05:00:07 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id FAA06275; Sat, 5 Apr 1997 05:00:03 -0800 (PST) Resent-Date: Sat, 5 Apr 1997 05:00:03 -0800 (PST) Resent-Message-Id: <199704051300.FAA06275@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, dima@tejblum.dnttm.rssi.ru Received: from helios.dnttm.ru (uutejb@dnttm.wave.ras.ru [194.85.104.197]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id EAA06217 for ; Sat, 5 Apr 1997 04:58:43 -0800 (PST) Received: (from uutejb@localhost) by helios.dnttm.ru (8.8.5/8.8.5/IP-2) with UUCP id RAA04401 for FreeBSD-gnats-submit@freebsd.org; Sat, 5 Apr 1997 17:01:26 +0400 Received: (from dima@localhost) by tejblum.dnttm.rssi.ru (8.8.5/8.8.5) id RAA01324; Sat, 5 Apr 1997 17:00:16 +0400 (MSD) Message-Id: <199704051300.RAA01324@tejblum.dnttm.rssi.ru> Date: Sat, 5 Apr 1997 17:00:16 +0400 (MSD) From: Dmitrij Tejblum Reply-To: dima@tejblum.dnttm.rssi.ru To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/3202: shutdown(8) don't work if started from an X Window Manager menu Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >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: