From ino-e95abb57@spotteswoode.dnsalias.org  Mon Jan 21 02:51:54 2002
Return-Path: <ino-e95abb57@spotteswoode.dnsalias.org>
Received: from mailout05.sul.t-online.com (mailout05.sul.t-online.com [194.25.134.82])
	by hub.freebsd.org (Postfix) with ESMTP id 4A91F37B404
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 21 Jan 2002 02:51:53 -0800 (PST)
Received: from fwd04.sul.t-online.de 
	by mailout05.sul.t-online.com with smtp 
	id 16Sbgh-0000pQ-03; Mon, 21 Jan 2002 11:28:27 +0100
Received: from spotteswoode.dnsalias.org (520082050842-0001@[217.5.89.248]) by fmrl04.sul.t-online.com
	with esmtp id 16Sbgc-0fbKkaC; Mon, 21 Jan 2002 11:28:22 +0100
Received: (qmail 1289 invoked by uid 0); 21 Jan 2002 10:28:21 -0000
Message-Id: <20020121102821.GA574@spotteswoode.dnsalias.org>
Date: 21 Jan 2002 11:28:21 +0100
From: "clemensF" <ino-e95abb57@spotteswoode.dnsalias.org>
To: FreeBSD-gnats-submit@freebsd.org
Subject: /etc/rc.shutdown isn't run on halt(8)
X-Send-Pr-Version: 3.113

>Number:         34109
>Category:       conf
>Synopsis:       /etc/rc.shutdown isn't run on halt(8)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 21 03:00:09 PST 2002
>Closed-Date:    Thu Jan 09 09:15:14 PST 2003
>Last-Modified:  Thu Jan 09 09:15:14 PST 2003
>Originator:     Tip Chap
>Release:        FreeBSD 4.3-RELEASE i386
>Organization:
private
>Environment:
System: FreeBSD spotteswoode.dnsalias.org 4.3-RELEASE FreeBSD 4.3-RELEASE #13: Sun Jan 13 11:53:26 CET 2002 root@spotteswoode.dnsalias.org:/usr/src/sys/compile/n1 i386


>Description:

	the documentation of neither init(8) not halt(8) doesn't tell that
/etc/rc.shutdown is only run when the system goes single-user after "kill
-TERM 1" or "init 1", i had to use the source code.  the documentation
(init) states:  "When shutting down the machine, init will try to run the
/etc/rc.shutdown script.  This script can be used to cleanly terminate
specific programs such as innd (the InterNetNews server)."

also, a template is provided in /etc, so i put all the shutdown-stuff in
there.  running this script only on transition to single-user is counter-
intuitive.  /etc/rc.shutdown is the logical place to put shutdown-code, so
it should be used on every shutdown.

>How-To-Repeat:

>Fix:

	use "sh /etc/rc.shutdown" before halting the machine, inform
administrators about the flaw in the documentation.

clemens fischer
>Release-Note:
>Audit-Trail:

From: Peter Pentchev <roam@ringlet.net>
To: clemensF <ino-e95abb57@spotteswoode.dnsalias.org>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: conf/34109: /etc/rc.shutdown isn't run on halt(8)
Date: Mon, 21 Jan 2002 13:53:25 +0200

 On Mon, Jan 21, 2002 at 11:28:21AM +0100, clemensF wrote:
 > >Number:         34109
 > >Category:       conf
 > >Synopsis:       /etc/rc.shutdown isn't run on halt(8)
 > >Originator:     Tip Chap
 > >Release:        FreeBSD 4.3-RELEASE i386
 > 
 > >Description:
 > 
 > 	the documentation of neither init(8) not halt(8) doesn't tell that
 > /etc/rc.shutdown is only run when the system goes single-user after "kill
 > -TERM 1" or "init 1", i had to use the source code.  the documentation
 > (init) states:  "When shutting down the machine, init will try to run the
 > /etc/rc.shutdown script.  This script can be used to cleanly terminate
 > specific programs such as innd (the InterNetNews server)."
 
 Errr.. how exactly did you try to shut your system down?
 The /etc/rc.shutdown script is run quite fine if you use the shutdown(8)
 utility, which also happens to be referenced in the halt(8) manual page.
 Quoting from the halt(8) manual page:
 
   Normally, the shutdown(8) utility is used when the system needs to be
   halted or restarted, giving users advance warning of their impending doom
   and cleanly terminating specific programs.
 
 Note the 'cleanly terminating specific programs' part :)
 
 G'luck,
 Peter
 
 -- 
 This sentence no verb.

From: "clemensF" <ino-e95abb57@spotteswoode.dnsalias.org>
To: "Peter Pentchev" <roam@ringlet.net>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: conf/34109: /etc/rc.shutdown isn't run on halt(8)
Date: 21 Jan 2002 15:42:39 +0100

 > Peter Pentchev:
 
 > Errr.. how exactly did you try to shut your system down?
 
 i do not need the functionality of shutdown(8), so i choose halt(8) to do
 the job.
 
 > The /etc/rc.shutdown script is run quite fine if you use the shutdown(8)
 
 i will try shutdown(8), but i'm really not sure i want it.
 
 >   Normally, the shutdown(8) utility is used when the system needs to be
 >   halted or restarted, giving users advance warning of their impending doom
 >   and cleanly terminating specific programs.
 > 
 > Note the 'cleanly terminating specific programs' part :)
 
 do you suggest users do guesswork to find out if a clearly defined script
 is run or not?  i'd prefer "... and runs /etc/rc.shutdown to cleanly
 terminate specific programs."
 
 clemens fischer

From: Peter Pentchev <roam@ringlet.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:  
Subject: Re: conf/34109: /etc/rc.shutdown isn't run on halt(8)
Date: Mon, 21 Jan 2002 16:56:44 +0200

 On Mon, Jan 21, 2002 at 03:42:39PM +0100, clemensF wrote:
 > > Peter Pentchev:
 > 
 > > Errr.. how exactly did you try to shut your system down?
 > 
 > i do not need the functionality of shutdown(8), so i choose halt(8) to do
 > the job.
 > 
 > > The /etc/rc.shutdown script is run quite fine if you use the shutdown(8)
 > 
 > i will try shutdown(8), but i'm really not sure i want it.
 
 There is no overhead in a 'shutdown -h now' or 'shutdown -r now'
 invocation, while there is a lot to be said about letting the system
 shut itself down gracefully.  halt(8) and reboot(8) are there only
 as a last resort utilities for really urgent cases.
 
 > >   Normally, the shutdown(8) utility is used when the system needs to be
 > >   halted or restarted, giving users advance warning of their impending doom
 > >   and cleanly terminating specific programs.
 > > 
 > > Note the 'cleanly terminating specific programs' part :)
 > 
 > do you suggest users do guesswork to find out if a clearly defined script
 > is run or not?  i'd prefer "... and runs /etc/rc.shutdown to cleanly
 > terminate specific programs."
 
 shutdown(8) does not run /etc/rc.shutdown; init(8) does.
 All that shutdown(8) does is initiate a system shutdown.
 
 G'luck,
 Peter
 
 -- 
 What would this sentence be like if it weren't self-referential?

From: "Crist J . Clark" <cjc@freebsd.org>
To: Peter Pentchev <roam@ringlet.net>
Cc: bug-followup@freebsd.org
Subject: Re: conf/34109: /etc/rc.shutdown isn't run on halt(8)
Date: Tue, 22 Jan 2002 00:01:33 -0800

 On Mon, Jan 21, 2002 at 07:00:05AM -0800, Peter Pentchev wrote:
 > On Mon, Jan 21, 2002 at 03:42:39PM +0100, clemensF wrote:
 > > > Peter Pentchev:
 
 [snip]
 
 > > >   Normally, the shutdown(8) utility is used when the system needs to be
 > > >   halted or restarted, giving users advance warning of their impending doom
 > > >   and cleanly terminating specific programs.
 > > > 
 > > > Note the 'cleanly terminating specific programs' part :)
 > > 
 > > do you suggest users do guesswork to find out if a clearly defined script
 > > is run or not?  i'd prefer "... and runs /etc/rc.shutdown to cleanly
 > > terminate specific programs."
 > 
 > shutdown(8) does not run /etc/rc.shutdown; init(8) does.
 > All that shutdown(8) does is initiate a system shutdown.
 
 I think the code is all sound. However, the init(8) manpage is not
 clear about when /etc/rc.shutdown is run.
 -- 
 Crist J. Clark                     |     cjclark@alum.mit.edu
                                    |     cjclark@jhu.edu
 http://people.freebsd.org/~cjc/    |     cjc@freebsd.org

From: "clemensF" <ino-e95abb57@spotteswoode.dnsalias.org>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: conf/34109: /etc/rc.shutdown isn't run on halt(8)
Date: 22 Jan 2002 15:43:47 +0100

 i rest my case, and i'm slowly getting used to shutdown(8).  only thing
 left would be changing the documentation.
 
 clemens fischer

From: Ruslan Ermilov <ru@FreeBSD.ORG>
To: "Crist J. Clark" <cjc@FreeBSD.ORG>
Cc: bug-followup@FreeBSD.ORG
Subject: Re: conf/34109: /etc/rc.shutdown isn't run on halt(8)
Date: Thu, 24 Jan 2002 11:23:22 +0200

 On Tue, Jan 22, 2002 at 12:10:01AM -0800, Crist J . Clark wrote:
 > The following reply was made to PR conf/34109; it has been noted by GNATS.
 > 
 > From: "Crist J . Clark" <cjc@freebsd.org>
 > To: Peter Pentchev <roam@ringlet.net>
 > Cc: bug-followup@freebsd.org
 > Subject: Re: conf/34109: /etc/rc.shutdown isn't run on halt(8)
 > Date: Tue, 22 Jan 2002 00:01:33 -0800
 > 
 >  On Mon, Jan 21, 2002 at 07:00:05AM -0800, Peter Pentchev wrote:
 >  > On Mon, Jan 21, 2002 at 03:42:39PM +0100, clemensF wrote:
 >  > > > Peter Pentchev:
 >  
 >  [snip]
 >  
 >  > > >   Normally, the shutdown(8) utility is used when the system needs to be
 >  > > >   halted or restarted, giving users advance warning of their impending doom
 >  > > >   and cleanly terminating specific programs.
 >  > > > 
 >  > > > Note the 'cleanly terminating specific programs' part :)
 >  > > 
 >  > > do you suggest users do guesswork to find out if a clearly defined script
 >  > > is run or not?  i'd prefer "... and runs /etc/rc.shutdown to cleanly
 >  > > terminate specific programs."
 >  > 
 >  > shutdown(8) does not run /etc/rc.shutdown; init(8) does.
 >  > All that shutdown(8) does is initiate a system shutdown.
 >  
 >  I think the code is all sound. However, the init(8) manpage is not
 >  clear about when /etc/rc.shutdown is run.
 >  
 I don't see a problem with documentation:
 
 : Init will terminate all possible processes (again, it will not wait for
 : deadlocked processes) and reboot the machine if sent the interrupt (INT)
 : signal, i.e. ``kill -INT 1''.  This is useful for shutting the machine
                                                     ^^^^^^^^^^^^^^^^^^^^
 : down cleanly from inside the kernel or from X when the machine appears to
   ^^^^^
 : be hung.
 : 
 : Init will do the same, except it will halt the machine if sent the user
                                         ^^^^
 : defined signal 1 (USR1), or will halt and turn the power off (if hardware
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 : permits) if sent the user defined signal 2 (USR2).
 : 
 : When shutting down the machine, init will try to run the /etc/rc.shutdown
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 : script.  This script can be used to cleanly terminate specific programs
 : such as innd (the InterNetNews server).
 
 The best thing we can do is to join the third paragraph with the first.
 
 
 Cheers,
 -- 
 Ruslan Ermilov		Oracle Developer/DBA,
 ru@sunbay.com		Sunbay Software AG,
 ru@FreeBSD.org		FreeBSD committer,
 +380.652.512.251	Simferopol, Ukraine
 
 http://www.FreeBSD.org	The Power To Serve
 http://www.oracle.com	Enabling The Information Age
State-Changed-From-To: open->closed 
State-Changed-By: trhodes 
State-Changed-When: Thu Jan 9 09:13:37 PST 2003 
State-Changed-Why:  
Reading over the documentation, I agree with ru.  Submitter also agrees to 
the final outcome.  Closed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=34109 
>Unformatted:
