NetBSD Problem Report #12823

Received: (qmail 28888 invoked from network); 3 May 2001 22:59:52 -0000
Message-Id: <200105032300.f43N0Wd23697@starjumper.starwolf.com>
Date: Thu, 3 May 2001 16:00:33 -0700 (PDT)
From: The Grey Wolf <greywolf@starwolf.com>
Reply-To: greywolf@starwolf.com
To: gnats-bugs@gnats.netbsd.org
Subject: inetd might want to run in foreground without debugging output
X-Send-Pr-Version: 3.95

>Number:         12823
>Category:       bin
>Synopsis:       request for addition of -f flag to inetd
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu May 03 23:00:00 +0000 2001
>Closed-Date:    
>Last-Modified:  Fri May 04 03:29:01 +0000 2001
>Originator:     
>Release:        current of 3 May 2001
>Organization:
Star Wolf Innovations

				--*greywolf;
--
*BSD: No Worries!
>Environment:
	N/A
System: NetBSD starjumper 1.5S NetBSD 1.5S (STARJUMPER) #2: Thu Feb 22 19:10:50 PST 2001 root@:/export/src/sys/arch/i386/compile/STARJUMPER i386
Architecture: i386
Machine: i386
>Description:
	inetd has a -d flag which produces debugging output while preventing
	detaching from its controlling terminal; sometimes it might be nice
	to have it sit in foreground without all that information (put a
	wrapper around it and catch a signal as to why it is dying, for
	example).  Patches included.

	I realise this may seem kind of silly, but the important daemons
	of which I know have a way of separating debugging from detachment.

>How-To-Repeat:
	N/A
>Fix:
--- inetd.c	Thu May  3 15:51:44 2001
+++ inetd.c.orig	Thu May  3 15:41:45 2001
@@ -271,7 +271,6 @@
 #ifdef LIBWRAP
 int	lflag;
 #endif
-int	foreground;
 int	nsock, maxsock;
 fd_set	allsock;
 int	options;
@@ -454,9 +453,9 @@

 	while ((ch = getopt(argc, argv,
 #ifdef LIBWRAP
-					"dlf"
+					"dl"
 #else
-					"df"
+					"d"
 #endif
 					   )) != -1)
 		switch(ch) {
@@ -469,9 +468,6 @@
 			lflag = 1;
 			break;
 #endif
-		case 'f':
-			foreground = 1;
-			break;
 		case '?':
 		default:
 			usage();
@@ -482,7 +478,7 @@
	if (argc > 0)
 		CONFIG = argv[0];

-	if (debug == 0 && foreground == 0)
+	if (debug == 0)
 		daemon(0, 0);
 	openlog("inetd", LOG_PID | LOG_NOWAIT, LOG_DAEMON);
 	pidfile(NULL);
@@ -2111,9 +2107,9 @@
 {

 #ifdef LIBWRAP
-	(void)fprintf(stderr, "usage: %s [-dfl] [conf]\n", getprogname());
+	(void)fprintf(stderr, "usage: %s [-dl] [conf]\n", getprogname());
 #else
-	(void)fprintf(stderr, "usage: %s [-df] [conf]\n", getprogname());
+	(void)fprintf(stderr, "usage: %s [-d] [conf]\n", getprogname());
 #endif
 	exit(1);
 }

--- inetd.8	Thu May  3 15:51:38 2001
+++ inetd.8.orig	Fri Mar 23 22:17:39 2001
@@ -79,7 +79,6 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl d
-.Op Fl f
 .Op Fl l
 .Op Ar configuration file
 .Sh DESCRIPTION
@@ -105,11 +104,6 @@
 .Bl -tag -width Ds
 .It Fl d
 Turns on debugging.
-.El
-.Pp
-.Bl -tag -width Ds
-.It Fl f
-Keeps inetd in the foreground but without verbose debugging output.
 .El
 .Pp
 .Bl -tag -width Ds
>Release-Note:
>Audit-Trail:

From: woods@weird.com (Greg A. Woods)
To: greywolf@starwolf.com
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/12823: inetd might want to run in foreground without debugging output
Date: Thu,  3 May 2001 21:42:40 -0400 (EDT)

 [ On Thursday, May 3, 2001 at 16:00:33 (-0700), The Grey Wolf wrote: ]
 > Subject: bin/12823: inetd might want to run in foreground without debugging output
 >
 > 
 > 	inetd has a -d flag which produces debugging output while preventing
 > 	detaching from its controlling terminal; sometimes it might be nice
 > 	to have it sit in foreground without all that information (put a
 > 	wrapper around it and catch a signal as to why it is dying, for
 > 	example).  Patches included.
 > 
 > 	I realise this may seem kind of silly, but the important daemons
 > 	of which I know have a way of separating debugging from detachment.

 Heh!  Thanks!  Now inetd will run perfectly fine from a SysV-style init!

 -- 
 							Greg A. Woods

 +1 416 218-0098      VE3TCP      <gwoods@acm.org>     <woods@robohack.ca>
 Planix, Inc. <woods@planix.com>;   Secrets of the Weird <woods@weird.com>

From: Greywolf <greywolf@starwolf.com>
To: "Greg A. Woods" <woods@weird.com>
Cc: <gnats-bugs@gnats.netbsd.org>
Subject: Re: bin/12823: inetd might want to run in foreground without debugging
 output
Date: Thu, 3 May 2001 20:29:30 -0700 (PDT)

 On Thu, 3 May 2001, Greg A. Woods wrote:

 # > 	inetd has a -d flag which produces debugging output while preventing
 # > 	detaching from its controlling terminal; sometimes it might be nice
 # > 	to have it sit in foreground without all that information (put a
 # > 	wrapper around it and catch a signal as to why it is dying, for
 # > 	example).  Patches included.
 # >
 # > 	I realise this may seem kind of silly, but the important daemons
 # > 	of which I know have a way of separating debugging from detachment.
 #
 # Heh!  Thanks!  Now inetd will run perfectly fine from a SysV-style init!

 Oh, go away.  :-)

 [aside: sysv init ONLY if it doesn't take up six separate signals, and ONLY
 if it can still give me a single-user shell on the console by itself
 (without the rcS and rcS.d crap), and if I don't have to put ttymons into
 inittab, and if it won't ask me which level to jump to when I hit ^D in
 single-user mode, and if sending a TERM to init will get it into single-user
 mode, and if I don't have to deal with all the S* and K* crap, and I
 don't have to deal with numbered runlevels, and [most importantly] ONLY if
 it doesn't force me to change my current paradigm of operation!  Oh, and...]

 (walks off into the sun as it sets in the east.)

 # 							Greg A. Woods

 				--*greywolf;
 --
 *BSD: Use the ENTIRE computer!

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.