From nobody  Thu Feb 11 12:38:16 1999
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.8/8.8.8) id MAA13676;
          Thu, 11 Feb 1999 12:38:16 -0800 (PST)
          (envelope-from nobody)
Message-Id: <199902112038.MAA13676@hub.freebsd.org>
Date: Thu, 11 Feb 1999 12:38:16 -0800 (PST)
From: philip@eilio.com
To: freebsd-gnats-submit@freebsd.org
Subject: 3.0-STABLE, rc.shutdown is still ignored.
X-Send-Pr-Version: www-1.0

>Number:         10035
>Category:       bin
>Synopsis:       3.0-STABLE, rc.shutdown is still ignored.
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 11 12:40:01 PST 1999
>Closed-Date:    Fri Jun 11 13:54:32 PDT 1999
>Last-Modified:  Fri Jun 11 13:55:26 PDT 1999
>Originator:     Philip Hallstrom
>Release:        3.0-19990209-STABLE
>Organization:
>Environment:
FreeBSD burlap.eilio.com 3.0-19990209-STABLE FreeBSD 3.0-19990209-STABLE #1: Tue Feb  9 23:55:45 PST 1999     root@burlap.eilio.com:/usr/src/sys/compile/BURLAP  i386

>Description:
When I do "shutdown -r now", rc.shutdown does not get run -- even though
the man page says it will.
>How-To-Repeat:
Put "echo foo" in rc.shutdown, and then do a "shutdown -r now"
>Fix:
I wouldn't even begin to guess :)

I do have a suggestion though.

Why not add "local_shutdown" (similar to local_startup) to rc.conf, then
add:

-----------------------------------------------------------------------
# If there is a global system configuration file, suck it in.
#
if [ -f /etc/rc.conf ]; then
        . /etc/rc.conf
fi

# for each valid dir in $local_shutdown, search for init scripts matching *.sh
if [ "X${local_shutdown}" != X"NO" ]; then
        echo -n 'Local package de-initialization:'
        for dir in ${local_shutdown}; do
                [ -d ${dir} ] && for script in ${dir}/*.sh; do
                        [ -x ${script} ] && \
                                (trap 'exit 1' 2 ; ${script} stop ; echo -n)
                done
        done
        echo .
fi
---------------------------------------------------------------------------

to rc.shutdown.  This way, we don't have to edit rc.shutdown (which
to me is like editing rc), but we still get all the cool features :)

(And yes, I come from a Solaris background so I am used to all the rc.d
dirs -- whether that's a good thing or not... I know I'm not going back :)

>Release-Note:
>Audit-Trail:

From: Cy Schubert - ITSD Open Systems Group <Cy.Schubert@uumail.gov.bc.ca>
To: freebsd-gnats-submit@freebsd.org, philip@eilio.com
Cc:  
Subject: Re: bin/10035: 3.0-STABLE, rc.shutdown is still ignored.
Date: Tue, 09 Mar 1999 17:48:39 -0800

 I've been asking myself this question myself, since upgrading from 
 2.2.8 to 3.1.0 and receiving many more .  After looking at the source, 
 shutdown -r, which performs a reboot(), will not run rc.shutdown.  To 
 run rc.shutdown, you need to do a shutdown now.  I've been thinking 
 that to perform a reboot you will need to create a shell script to [for 
 example] touch a file in /var/run, then issue a shutdown now.  
 rc.shutdown would reboot, halt, or go sigle-user based upon which file 
 would exist (or the contents of the file) in /var/run.  In a sense this 
 is vaguely similar in function what the SYSV init does when you send it 
 an "init 6" or "init 0".
 
 Reboot(2) on the other hand is a system call that syncs the file 
 systems and reboots or shuts down.  I suppose that reboot could signal 
 init to run rc.shutdown, however this would be more consistent with 
 SYSV rather than BSD.
 
 
 Regards,                       Phone:  (250)387-8437
 Cy Schubert                      Fax:  (250)387-5766
 Open Systems Group          Internet:  Cy.Schubert@uumail.gov.bc.ca
 ITSD                                   Cy.Schubert@gems8.gov.bc.ca
 Province of BC            
 
 
 
 
State-Changed-From-To: open->closed 
State-Changed-By: ru 
State-Changed-When: Fri Jun 11 13:54:32 PDT 1999 
State-Changed-Why:  
Superseded by PR#5451. 
>Unformatted:
