Bug 3202 - shutdown(8) don't work if started from an X Window Manager menu
Summary: shutdown(8) don't work if started from an X Window Manager menu
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 3.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1997-04-05 14:00 UTC by Dmitrij Tejblum
Modified: 1997-08-23 15:18 UTC (History)
0 users

See Also:


Attachments
file.diff (699 bytes, patch)
1997-04-05 14:00 UTC, Dmitrij Tejblum
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitrij Tejblum 1997-04-05 14:00:02 UTC
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.

Fix: May be this is not the best way, but it is simple.
Comment 1 Joerg Wunsch 1997-04-05 15:42:23 UTC
As Dmitrij Tejblum wrote:

> >Fix:
> 	
> May be this is not the best way, but it is simple.

I don't think it's a good fix.  If at all, shutdown itself should
prevent the signal delivery to reboot(8).  After all, shutdown is the
program that goes into background, while reboot is a plain foreground
program (which i expect to be able to abort using ^C if i hit it
quickly after typing the command).

Note that you should also get away with something like

	...	exec "trap 1 2 15 ''; shutdown -h now"

in your window manager menu.

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)
Comment 2 Dmitrij Tejblum 1997-04-06 11:27:34 UTC
On Sat, 5 Apr 1997, J Wunsch wrote:

> I don't think it's a good fix.  If at all, shutdown itself should
> prevent the signal delivery to reboot(8).  After all, shutdown is the
> program that goes into background, while reboot is a plain foreground
> program (which i expect to be able to abort using ^C if i hit it
> quickly after typing the command).

Well, second variant:

*** src/sbin/shutdown/shutdown.c.orig	Sat Mar 29 21:48:33 1997
--- src/sbin/shutdown/shutdown.c	Sun Apr  6 13:58:18 1997
***************
*** 199,204 ****
--- 199,205 ----
  			(void)printf("shutdown: [pid %d]\n", forkpid);
  			exit(0);
  		}
+ 		setsid();
  	}
  #endif
  	openlog("shutdown", LOG_CONS, LOG_AUTH);


> 
> Note that you should also get away with something like
> 
> 	...	exec "trap 1 2 15 ''; shutdown -h now"
> 
> in your window manager menu.
> 

Probably. But such things cannot be called "user-friendly".

	Dima
Comment 3 Joerg Wunsch freebsd_committer freebsd_triage 1997-08-23 15:18:09 UTC
State Changed
From-To: open->closed


Suggested fix applied in rev 1.8 of shutdown.c.