From rustam@eanetways.com Tue Jun  8 23:18:12 1999
Return-Path: <rustam@eanetways.com>
Received: from ns.eanetways.com (ns.eanetways.com [195.239.197.2])
	by hub.freebsd.org (Postfix) with ESMTP id 01CF614EDE
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  8 Jun 1999 23:17:58 -0700 (PDT)
	(envelope-from rustam@eanetways.com)
Received: (from rustam@localhost)
	by ns.eanetways.com (8.9.3/8.9.3) id LAA60242;
	Wed, 9 Jun 1999 11:19:14 +0500 (UZT)
Message-Id: <199906090619.LAA60242@ns.eanetways.com>
Date: Wed, 9 Jun 1999 11:19:14 +0500 (UZT)
From: Rustam Abdullaev <rustam@eanetways.com>
Reply-To: rustam@eanetways.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: /sbin/reboot does not run /etc/rc.shutdown
X-Send-Pr-Version: 3.2

>Number:         12093
>Category:       bin
>Synopsis:       /sbin/reboot does not run /etc/rc.shutdown during reboot
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun  8 23:20:01 PDT 1999
>Closed-Date:    Wed Jun 9 01:13:34 PDT 1999
>Last-Modified:  Sun Jun 20 23:30:02 PDT 1999
>Originator:     Rustam Abdullaev
>Release:        FreeBSD 3.2-STABLE i386
>Organization:
EurAsia NetWays ISP
>Environment:
>Description:
when I reboot or halt my FreeBSD box using Ctrl-Alt-Del or kill 1, the
init process successfully runs /etc/rc.shutdown, but when I try
/sbin/reboot or /sbin/halt, the init process gets stopped and has no
chance to run /etc/rc.shutdown

>How-To-Repeat:
/sbin/reboot

>Fix:
Copy the runshutdown() function from /sbin/init into /sbin/reboot and use it
before stopping init.


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: ru 
State-Changed-When: Wed Jun 9 01:13:34 PDT 1999 
State-Changed-Why:  
Not a bug. 
init(8) executes rc.shutdown whenever it receives SIGTERM signal. 
reboot(8) explicitly prevents this by sending init(8) SIGTSTP signal. 
You can use shutdown(8) to terminate your system gracefully. 

From: Studded <Studded@gorean.org>
To: Ruslan Ermilov <ru@FreeBSD.ORG>
Cc: MIHIRA Yoshiro <sanpei@sanpei.org>, rustam@eanetways.com,
	freebsd-bugs@FreeBSD.ORG, freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: bin/12093: /sbin/reboot does not run /etc/rc.shutdown during reboot
Date: Sat, 19 Jun 1999 02:07:10 -0700

 Ruslan Ermilov wrote:
 > 
 > On Thu, Jun 10, 1999 at 12:42:39PM +0900, MIHIRA Yoshiro wrote:
 > > ru@FreeBSD.ORG wrote:
 > >
 > > >> Synopsis: /sbin/reboot does not run /etc/rc.shutdown during reboot
 > > >>
 > > >> State-Changed-From-To: open->closed
 > > >> State-Changed-By: ru
 > > >> State-Changed-When: Wed Jun 9 01:13:34 PDT 1999
 > > >> State-Changed-Why:
 > > >> Not a bug.
 > > >> init(8) executes rc.shutdown whenever it receives SIGTERM signal.
 > > >> reboot(8) explicitly prevents this by sending init(8) SIGTSTP signal.
 > > >> You can use shutdown(8) to terminate your system gracefully.
 > >
 > >   But
 > >       shutdown -h now         --> not execute /etc/rc.shutdown
 > >
 > It shouldn't execute /etc/rc.shutdown:
 > 
 > shutdown(8):
 > 
 > -h      The system is halted at the specified time when shutdown executes
 >         halt(8).
 > 
 > halt(8) is a link to reboot(8), and it acts like reboot, i.e.
 > explicitly send init(8) SIGTSTP signal to prevent it from running
 > /etc/rc.shutdown.
 > 
 > There are two ways to shutdown your system gracefully:
 > 1) Explicitly send init(8) SIGTERM signal (kill -15 1)
 > 2) Run ``shutdown [time]'' without specifying -h -r -p switches.
 
 	Neither of which is acceptable if you are issuing the command remotely and
 absolutely must have the system reboot.
 

From: Ruslan Ermilov <ru@FreeBSD.ORG>
To: Studded <Studded@gorean.org>
Cc: MIHIRA Yoshiro <sanpei@sanpei.org>, rustam@eanetways.com,
	freebsd-bugs@FreeBSD.ORG, freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: bin/12093: /sbin/reboot does not run /etc/rc.shutdown during reboot
Date: Mon, 21 Jun 1999 09:15:40 +0300

 On Sat, Jun 19, 1999 at 02:07:10AM -0700, Studded wrote:
 > Ruslan Ermilov wrote:
 > > 
 > > On Thu, Jun 10, 1999 at 12:42:39PM +0900, MIHIRA Yoshiro wrote:
 > > > ru@FreeBSD.ORG wrote:
 > > >
 > > > >> Synopsis: /sbin/reboot does not run /etc/rc.shutdown during reboot
 > > > >>
 > > > >> State-Changed-From-To: open->closed
 > > > >> State-Changed-By: ru
 > > > >> State-Changed-When: Wed Jun 9 01:13:34 PDT 1999
 > > > >> State-Changed-Why:
 > > > >> Not a bug.
 > > > >> init(8) executes rc.shutdown whenever it receives SIGTERM signal.
 > > > >> reboot(8) explicitly prevents this by sending init(8) SIGTSTP signal.
 > > > >> You can use shutdown(8) to terminate your system gracefully.
 > > >
 > > >   But
 > > >       shutdown -h now         --> not execute /etc/rc.shutdown
 > > >
 > > It shouldn't execute /etc/rc.shutdown:
 > > 
 > > shutdown(8):
 > > 
 > > -h      The system is halted at the specified time when shutdown executes
 > >         halt(8).
 > > 
 > > halt(8) is a link to reboot(8), and it acts like reboot, i.e.
 > > explicitly send init(8) SIGTSTP signal to prevent it from running
 > > /etc/rc.shutdown.
 > > 
 > > There are two ways to shutdown your system gracefully:
 > > 1) Explicitly send init(8) SIGTERM signal (kill -15 1)
 > > 2) Run ``shutdown [time]'' without specifying -h -r -p switches.
 > 
 > 	Neither of which is acceptable if you are issuing the command remotely and
 > absolutely must have the system reboot.
 > 
 Init(8) will run /etc/rc.shutdown and then reboot your system if send SIGINT.
 
 P.S.
 I'm working on init(8) and shutdown(8) code now to improve their functionality.
 Init(8) in 4.0-CURRENT now supports SIGUSR1 (halt) and SIGUSR2 (halt+poweroff).
 
 
 Cheers,
 -- 
 Ruslan Ermilov		Sysadmin and DBA of the
 ru@ucb.crimea.ua	United Commercial Bank,
 ru@FreeBSD.org		FreeBSD committer,
 +380.652.247.647	Simferopol, Ukraine
 
 http://www.FreeBSD.org	The Power To Serve
 http://www.oracle.com	Enabling The Information Age
 
>Unformatted:
 
