Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Jan 1997 18:35:42 +0100
From:      j@uriah.heep.sax.de (J Wunsch)
To:        hackers@freebsd.org
Subject:   Re: DEVFS permissions &c.
Message-ID:  <Mutt.19970112183542.j@uriah.heep.sax.de>
In-Reply-To: <Mutt.19970112160314.roberto@keltia.freenix.fr>; from Ollivier Robert on Jan 12, 1997 16:03:14 %2B0100
References:  <Mutt.19970111201007.j@uriah.heep.sax.de> <16902.853042470@time.cdrom.com> <Mutt.19970112112012.j@uriah.heep.sax.de> <Mutt.19970112160314.roberto@keltia.freenix.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
As Ollivier Robert wrote:

> May I remind everyone that I proposed a change for this in 1994 ? :-)

Some things need time to get ripe. ;-)

Well, i remember that the issue popped up every now and then.  During
the last discussion, i remember that there has been reached basic
agreement that a shutdown script would be a good thing.

> In this scheme, init does all the job of bringing the system down and
> reboot/halt only send a signal to init instead of doing the job themselves.
> The patch for reboot/halt has to be written though.

Why do they need to be changed?  If somebody says `reboot -q', it
doesn't need to go via init.

> +	/* Try to run the rc.shutdown script */
> +	rcdown = runshutdown();
> +	if (rcdown)
> +		stall("Could not run %s, check this please.", _PATH_RUNDOWN);
> +

I think stall() is the wrong thing to do here.  If the shutdown script
fails, it's best to log what can be logged, and proceed to really shut
down the system to the desired state.

Otherwise, considere a machine that's rebooted remotely: you _want_ to
have it rebooted, whatever might happen.  If it fails to execute part
of the shutdown procedure, you can learn this from the log after it
rebooted.  Having it jumping out to single-user will cause a fatal
error since you need an operator on the console afterwards.

> + * Exit codes:      XXX I should document more
> + * 0        good.
> + * 1        fatal error
> + * 2        some error

Same as above.

> +	/*
> +	 * Copied from single_user().  This is a bit paranoid.
> +	 */
> +	do {
> +		if ((wpid = waitpid(-1, &status, WUNTRACED)) != -1)
> +			collect_child(wpid);

Here's an alarm() missing, to prevent infinite hangs of the shutdown
script.  Such an infinite hang should be answered with sending
rc.shutdown a terminate signal, and by syslogging it.

-- 
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. ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Mutt.19970112183542.j>