From mwm@mired.org  Thu May 17 16:42:41 2001
Return-Path: <mwm@mired.org>
Received: from guru.mired.org (okc-65-26-235-186.mmcable.com [65.26.235.186])
	by hub.freebsd.org (Postfix) with SMTP id 8D05D37B423
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 17 May 2001 16:42:40 -0700 (PDT)
	(envelope-from mwm@mired.org)
Received: (qmail 21737 invoked by uid 100); 17 May 2001 23:42:38 -0000
Message-Id: <20010517234238.21736.qmail@guru.mired.org>
Date: 17 May 2001 23:42:38 -0000
From: mwm@mired.org
Reply-To: mwm@mired.org
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: There are *no* examples of using /etc/ttys inittab-like feature
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         27418
>Category:       conf
>Synopsis:       There are *no* examples of using /etc/ttys inittab-like feature
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 17 16:50:01 PDT 2001
>Closed-Date:    Thu Sep 6 06:26:18 PDT 2001
>Last-Modified:  Thu Sep 06 06:26:51 PDT 2001
>Originator:     Mike Meyer
>Release:        FreeBSD 4.3-STABLE i386
>Organization:
Meyer Consulting
>Environment:
System: FreeBSD guru.mired.org 4.3-STABLE FreeBSD 4.3-STABLE #15: Sun May 13 15:33:37 CDT 2001 mwm@guru.mired.org:/sharetmp/obj/usr/src/sys/GURU i386


>Description:

The init page mentions - in one paragraph - that /etc/ttys can be used to
start a daemon, similar to the SysV /etc/inittab. This doesn't include an
example, and there don't seem to be any such examples.

>How-To-Repeat:

Read the man page and look for examples.

>Fix:

Here's a patch to add an example - turned off - to /etc/ttys.

--- /etc/ttys	Thu May 17 18:31:22 2001
+++ /tmp/ttys	Thu May 17 18:38:10 2001
@@ -46,6 +46,10 @@
 ttyd1	"/usr/libexec/getty std.9600"	dialup	off secure
 ttyd2	"/usr/libexec/getty std.9600"	dialup	off secure
 ttyd3	"/usr/libexec/getty std.9600"	dialup	off secure
+# Daemon example
+# This will make init run /tmp/testd with an argument of "Example", restarting
+# it whenever it exits.
+Example	"/usr/libexec/sampledaemon"	none	off
 # Pseudo terminals
 ttyp0	none			network
 ttyp1	none			network

>Release-Note:
>Audit-Trail:

From: Dima Dorfman <dima@unixfreak.org>
To: mwm@mired.org
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: conf/27418: There are *no* examples of using /etc/ttys inittab-like feature 
Date: Thu, 17 May 2001 22:07:52 -0700

 mwm@mired.org writes:
 > 
 > >Number:         27418
 > >Category:       conf
 > >Synopsis:       There are *no* examples of using /etc/ttys inittab-like feature
 > --- /etc/ttys	Thu May 17 18:31:22 2001
 > +++ /tmp/ttys	Thu May 17 18:38:10 2001
 > @@ -46,6 +46,10 @@
 >  ttyd1	"/usr/libexec/getty std.9600"	dialup	off secure
 >  ttyd2	"/usr/libexec/getty std.9600"	dialup	off secure
 >  ttyd3	"/usr/libexec/getty std.9600"	dialup	off secure
 > +# Daemon example
 > +# This will make init run /tmp/testd with an argument of "Example", restarti
 > ng
 > +# it whenever it exits.
 > +Example	"/usr/libexec/sampledaemon"	none	off
 
 So is it /tmp/testd or /usr/libexec/sampledaemon?  Or am I missing something?
 
 >  # Pseudo terminals
 >  ttyp0	none			network
 >  ttyp1	none			network
 > 
 > >Release-Note:
 > >Audit-Trail:
 > >Unformatted:
 > 
 > To Unsubscribe: send mail to majordomo@FreeBSD.org
 > with "unsubscribe freebsd-bugs" in the body of the message
 > 

From: Mike Meyer <mwm@mired.org>
To: Dima Dorfman <dima@unixfreak.org>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: conf/27418: There are *no* examples of using /etc/ttys inittab-like feature 
Date: Fri, 18 May 2001 02:25:44 -0500

 Dima Dorfman <dima@unixfreak.org> types:
 > mwm@mired.org writes:
 > > 
 > > >Number:         27418
 > > >Category:       conf
 > > >Synopsis:       There are *no* examples of using /etc/ttys inittab-like feature
 > > --- /etc/ttys	Thu May 17 18:31:22 2001
 > > +++ /tmp/ttys	Thu May 17 18:38:10 2001
 > > @@ -46,6 +46,10 @@
 > >  ttyd1	"/usr/libexec/getty std.9600"	dialup	off secure
 > >  ttyd2	"/usr/libexec/getty std.9600"	dialup	off secure
 > >  ttyd3	"/usr/libexec/getty std.9600"	dialup	off secure
 > > +# Daemon example
 > > +# This will make init run /tmp/testd with an argument of "Example", restarti
 > > ng
 > > +# it whenever it exits.
 > > +Example	"/usr/libexec/sampledaemon"	none	off
 > 
 > So is it /tmp/testd or /usr/libexec/sampledaemon?  Or am I missing something?
 
 No, you're not missing anything. I did it as "/tmp/testd" when I
 tested it, and changed it halfway through - but only got one of the
 two places with the file name. The example quoted will run
 /usr/libexec/sampledaemon.
 
 	<mike
 --
 Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
 Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

From: Doug Barton <DougB@DougBarton.net>
To: mwm@mired.org
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: conf/27418: There are *no* examples of using /etc/ttys inittab-like 
 feature
Date: Tue, 22 May 2001 15:20:09 -0700

 mwm@mired.org wrote:
 
 > The init page mentions - in one paragraph - that /etc/ttys can be used to
 > start a daemon, similar to the SysV /etc/inittab. This doesn't include an
 > example, and there don't seem to be any such examples.
 
 	I think that's because in practice it doesn't work well for daemons that
 fork and put themselves in the background. getty doesn't do that, so init
 holds it open continuously, and respawns a new copy if the one it's holding
 open dies. In the case of a standard daemon, init will continuously restart
 it since when init runs the command the copy it's trying to hold open
 "disappears" each time.
 
 	How would you feel about amending the man page to describe this problem
 instead of adding an example to /etc/ttys?
 
 Doug

From: Peter Pentchev <roam@orbitel.bg>
To: Doug Barton <DougB@DougBarton.net>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: conf/27418: There are *no* examples of using /etc/ttys inittab-like feature
Date: Wed, 23 May 2001 09:17:08 +0300

 On Tue, May 22, 2001 at 03:30:03PM -0700, Doug Barton wrote:
 > The following reply was made to PR conf/27418; it has been noted by GNATS.
 > 
 > From: Doug Barton <DougB@DougBarton.net>
 > To: mwm@mired.org
 > Cc: FreeBSD-gnats-submit@FreeBSD.ORG
 > Subject: Re: conf/27418: There are *no* examples of using /etc/ttys inittab-like 
 >  feature
 > Date: Tue, 22 May 2001 15:20:09 -0700
 > 
 >  mwm@mired.org wrote:
 >  
 >  > The init page mentions - in one paragraph - that /etc/ttys can be used to
 >  > start a daemon, similar to the SysV /etc/inittab. This doesn't include an
 >  > example, and there don't seem to be any such examples.
 >  
 >  	I think that's because in practice it doesn't work well for daemons that
 >  fork and put themselves in the background. getty doesn't do that, so init
 >  holds it open continuously, and respawns a new copy if the one it's holding
 >  open dies. In the case of a standard daemon, init will continuously restart
 >  it since when init runs the command the copy it's trying to hold open
 >  "disappears" each time.
 >  
 >  	How would you feel about amending the man page to describe this problem
 >  instead of adding an example to /etc/ttys?
 
 Isn't this the (standard, expected) behavior for init(8) when handling
 SysV-style /etc/inittab-started daemons?
 
 G'luck,
 Peter
 
 -- 
 I am the meaning of this sentence.
State-Changed-From-To: open->closed 
State-Changed-By: dd 
State-Changed-When: Thu Sep 6 06:26:18 PDT 2001 
State-Changed-Why:  
According to the audit-trail, consensus seems to be that it's best to 
ammend the man page.  Please file a docs PR if/when you're done. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27418 
>Unformatted:
