From 4012c9269aa9d29f8205bd1a69d4d7381667a692 Mon Sep 17 00:00:00 2001 From: wollman Date: Thu, 12 Oct 1995 16:43:27 +0000 Subject: [PATCH] Record PID in /var/run/inetd.pid and document same. --- usr.sbin/inetd/inetd.8 | 26 +++++++++++++++++++++++--- usr.sbin/inetd/inetd.c | 11 ++++++++++- usr.sbin/inetd/pathnames.h | 1 + 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/usr.sbin/inetd/inetd.8 b/usr.sbin/inetd/inetd.8 index d00c2790322c..5632c5c2109b 100644 --- a/usr.sbin/inetd/inetd.8 +++ b/usr.sbin/inetd/inetd.8 @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" from: @(#)inetd.8 8.3 (Berkeley) 4/13/94 -.\" $Id: inetd.8,v 1.4 1994/12/21 19:08:41 wollman Exp $ +.\" $Id: inetd.8,v 1.5 1995/10/09 23:34:07 davidg Exp $ .\" .Dd April 13, 1994 .Dt INETD 8 @@ -322,6 +322,11 @@ rereads its configuration file when it receives a hangup signal, .Dv SIGHUP . Services may be added, deleted or modified when the configuration file is reread. +Except when started in debugging mode, +.Nm +records its process ID in the file +.Pa /var/run/inetd.pid +to assist in reconfiguration. .Sh TCPMUX .Pp .Tn RFC 1078 @@ -347,6 +352,18 @@ causes .Nm inetd to list TCPMUX services in .Pa inetd.conf . +.Sh "FILES" +.Bl -tag -width /var/run/inetd.pid -compact +.It Pa /etc/inetd.conf +configuration file. +.It Pa /etc/rpc +translation of service names to RPC program numbers. +.It Pa /etc/services +translation of service names to port numbers. +.It Pa /var/run/inetd.pid +the pid of the currently running +.Nm inetd . +.El .Sh "EXAMPLES" .Pp Here are several example service entries for the various types of services: @@ -406,6 +423,8 @@ The user or group ID for the entry's .Em user is invalid. .Sh SEE ALSO +.Xr rpc 5 , +.Xr services 5 , .Xr comsat 8 , .Xr fingerd 8 , .Xr ftpd 8 , @@ -423,7 +442,8 @@ command appeared in .Bx 4.3 . TCPMUX is based on code and documentation by Mark Lottor. Support for -.Em Sun-RPC +.Tn "ONC RPC" based services is modelled after that provided by -.Em SunOS 4.1 . +.Tn SunOS +4.1. diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c index 3d921f25bccb..ca2fc39344ed 100644 --- a/usr.sbin/inetd/inetd.c +++ b/usr.sbin/inetd/inetd.c @@ -40,7 +40,7 @@ static char copyright[] = #ifndef lint /* from: @(#)inetd.c 8.4 (Berkeley) 4/13/94"; */ static char inetd_c_rcsid[] = - "$Id: inetd.c,v 1.5.2.1 1995/06/05 01:01:19 davidg Exp $"; + "$Id: inetd.c,v 1.6 1995/06/11 19:32:39 rgrimes Exp $"; #endif /* not lint */ /* @@ -296,7 +296,16 @@ main(argc, argv, envp) if (argc > 0) CONFIG = argv[0]; if (debug == 0) { + FILE *fp; daemon(0, 0); + pid = getpid(); + fp = fopen(_PATH_INETDPID, "w"); + if (fp) { + fprintf(fp, "%ld\n", (long)pid); + fclose(fp); + } else { + syslog(LOG_WARNING, _PATH_INETDPID ": %m"); + } } memset(&sv, 0, sizeof(sv)); sv.sv_mask = SIGBLOCK; diff --git a/usr.sbin/inetd/pathnames.h b/usr.sbin/inetd/pathnames.h index e8ae3cd4a10d..7b0bd31de614 100644 --- a/usr.sbin/inetd/pathnames.h +++ b/usr.sbin/inetd/pathnames.h @@ -36,3 +36,4 @@ #include #define _PATH_INETDCONF "/etc/inetd.conf" +#define _PATH_INETDPID _PATH_VARRUN "inetd.pid"