summaryrefslogtreecommitdiffstats
path: root/usr.sbin/inetd
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1995-10-12 16:43:27 +0000
committerwollman <wollman@FreeBSD.org>1995-10-12 16:43:27 +0000
commit4012c9269aa9d29f8205bd1a69d4d7381667a692 (patch)
tree1048b4b14813ca8c6c2950ec8c436b07d06093a6 /usr.sbin/inetd
parent0ba2aa8cba790982c132d5768e8497692e7931e7 (diff)
downloadFreeBSD-src-4012c9269aa9d29f8205bd1a69d4d7381667a692.zip
FreeBSD-src-4012c9269aa9d29f8205bd1a69d4d7381667a692.tar.gz
Record PID in /var/run/inetd.pid and document same.
Diffstat (limited to 'usr.sbin/inetd')
-rw-r--r--usr.sbin/inetd/inetd.826
-rw-r--r--usr.sbin/inetd/inetd.c11
-rw-r--r--usr.sbin/inetd/pathnames.h1
3 files changed, 34 insertions, 4 deletions
diff --git a/usr.sbin/inetd/inetd.8 b/usr.sbin/inetd/inetd.8
index d00c279..5632c5c 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 3d921f2..ca2fc39 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 e8ae3cd..7b0bd31 100644
--- a/usr.sbin/inetd/pathnames.h
+++ b/usr.sbin/inetd/pathnames.h
@@ -36,3 +36,4 @@
#include <paths.h>
#define _PATH_INETDCONF "/etc/inetd.conf"
+#define _PATH_INETDPID _PATH_VARRUN "inetd.pid"
OpenPOWER on IntegriCloud