From nobody@FreeBSD.org  Tue Apr 17 00:07:59 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 56C8D37B422
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 17 Apr 2001 00:07:59 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.1/8.11.1) id f3H77xi60302;
	Tue, 17 Apr 2001 00:07:59 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200104170707.f3H77xi60302@freefall.freebsd.org>
Date: Tue, 17 Apr 2001 00:07:59 -0700 (PDT)
From: matt@braithwaite.net
To: freebsd-gnats-submit@FreeBSD.org
Subject: If /etc/ttys goes empty, init(8) never rereads it
X-Send-Pr-Version: www-1.0

>Number:         26636
>Category:       misc
>Synopsis:       If /etc/ttys goes empty, init(8) never rereads it
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 17 00:10:02 PDT 2001
>Closed-Date:    Wed Jun 19 17:21:31 PDT 2002
>Last-Modified:  Sun Jul 21 09:00:07 PDT 2002
>Originator:     Matthew Braithwaite
>Release:        4.2-RELEASE
>Organization:
>Environment:
>Description:
If you empty out /etc/ttys, HUP init, and then put something back in /etc/ttys, init will never spawn anything ever again.
>How-To-Repeat:

>Fix:
This patch was not made with an understanding of init, so it may well introduce problems.  It merely points the direction to the solution of this problem.

*** init.c~     Wed Aug 23 00:08:22 2000
--- init.c      Mon Apr 16 23:53:36 2001
***************
*** 1341,1349 ****
        register int devlen;
        char *old_getty, *old_window, *old_type;
  
-       if (! sessions)
-               return (state_func_t) multi_user;
- 
        /* 
         * mark all sessions for death, (!SE_PRESENT) 
         * as we find or create new ones they'll be marked as keepers,
--- 1341,1346 ----

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: johan 
State-Changed-When: Wed Jun 19 17:20:25 PDT 2002 
State-Changed-Why:  
This is the expected behaviour. 

It is clearly stated in the manpage that one 
have to send a HUP signal to init for it to reread 
the ttys file. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=26636 

From: Johan Karlsson <johan@FreeBSD.org>
To: Matthew Braithwaite <matt@braithwaite.net>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/26636: If /etc/ttys goes empty, init(8) never rereads it
Date: Sun, 21 Jul 2002 17:51:33 +0200

 On Sat, Jul 13, 2002 at 17:39 (-0700) +0000, Matthew Braithwaite wrote:
 > > 	It is clearly stated in the manpage that one
 > > 	have to send a HUP signal to init for it to reread
 > > 	the ttys file.
 > 
 > Yes, I know that.  But after /etc/ttys has gone empty, a SIGHUP won't
 > make init reread it.  
 
 
 Ok, so does
 
 1: clear /etc/ttys
 2: SIGHUP init
 2.5: make sure nothing is started by init
 3: restore /etc/ttys
 4: SIGHUP init
 4.5: make sure the stuff in ttys is started by init
 
 not work as excpected for you?
 
 If not, what happens?
 
 It seems to work for me. Maybe you are doing something different from
 me.
 
 /Johan K
 -- 
 Johan Karlsson		mailto:johan@FreeBSD.org
>Unformatted:
