View | Details | Raw Unified | Return to bug 197379
Collapse All | Expand All

(-)usr.sbin/syslogd/syslogd.8 (-1 / +12 lines)
Lines 36-42 Link Here
36
.Nd log systems messages
36
.Nd log systems messages
37
.Sh SYNOPSIS
37
.Sh SYNOPSIS
38
.Nm
38
.Nm
39
.Op Fl 468ACcdkNnosTuv
39
.Op Fl 468ACcdFkNnosTuv
40
.Op Fl a Ar allowed_peer
40
.Op Fl a Ar allowed_peer
41
.Op Fl b Ar bind_address
41
.Op Fl b Ar bind_address
42
.Op Fl f Ar config_file
42
.Op Fl f Ar config_file
Lines 213-218 Link Here
213
Specify the pathname of an alternate configuration file;
213
Specify the pathname of an alternate configuration file;
214
the default is
214
the default is
215
.Pa /etc/syslog.conf .
215
.Pa /etc/syslog.conf .
216
.It Fl F
217
Run
218
.Nm
219
in the foreground, rather than going into daemon mode. This is useful if
220
some other process uses
221
.Xr fork 2
222
and
223
.Xr exec 3
224
to run
225
.Nm ,
226
and wants to monitor when and how it exits.
216
.It Fl k
227
.It Fl k
217
Disable the translation of
228
Disable the translation of
218
messages received with facility
229
messages received with facility
(-)usr.sbin/syslogd/syslogd.c (-3 / +7 lines)
Lines 271-276 Link Here
271
static struct filed consfile;	/* Console */
271
static struct filed consfile;	/* Console */
272
272
273
static int	Debug;		/* debug flag */
273
static int	Debug;		/* debug flag */
274
static int	Foreground = 0;	/* Run in foreground, instead of daemonizing */
274
static int	resolve = 1;	/* resolve hostname */
275
static int	resolve = 1;	/* resolve hostname */
275
static char	LocalHostName[MAXHOSTNAMELEN];	/* our hostname */
276
static char	LocalHostName[MAXHOSTNAMELEN];	/* our hostname */
276
static const char *LocalDomain;	/* our local domain name */
277
static const char *LocalDomain;	/* our local domain name */
Lines 360-366 Link Here
360
		dprintf("madvise() failed: %s\n", strerror(errno));
361
		dprintf("madvise() failed: %s\n", strerror(errno));
361
362
362
	bindhostname = NULL;
363
	bindhostname = NULL;
363
	while ((ch = getopt(argc, argv, "468Aa:b:cCdf:kl:m:nNop:P:sS:Tuv"))
364
	while ((ch = getopt(argc, argv, "468Aa:b:cCdf:Fkl:m:nNop:P:sS:Tuv"))
364
	    != -1)
365
	    != -1)
365
		switch (ch) {
366
		switch (ch) {
366
		case '4':
367
		case '4':
Lines 396-401 Link Here
396
		case 'f':		/* configuration file */
397
		case 'f':		/* configuration file */
397
			ConfFile = optarg;
398
			ConfFile = optarg;
398
			break;
399
			break;
400
		case 'F':		/* run in foreground instead of daemon */
401
			Foreground++;
402
			break;
399
		case 'k':		/* keep remote kern fac */
403
		case 'k':		/* keep remote kern fac */
400
			KeepKernFac = 1;
404
			KeepKernFac = 1;
401
			break;
405
			break;
Lines 487-500 Link Here
487
		warn("cannot open pid file");
491
		warn("cannot open pid file");
488
	}
492
	}
489
493
490
	if (!Debug) {
494
	if ((!Foreground) && (!Debug)) {
491
		ppid = waitdaemon(0, 0, 30);
495
		ppid = waitdaemon(0, 0, 30);
492
		if (ppid < 0) {
496
		if (ppid < 0) {
493
			warn("could not become daemon");
497
			warn("could not become daemon");
494
			pidfile_remove(pfh);
498
			pidfile_remove(pfh);
495
			exit(1);
499
			exit(1);
496
		}
500
		}
497
	} else {
501
	} else if (Debug) {
498
		setlinebuf(stdout);
502
		setlinebuf(stdout);
499
	}
503
	}
500
504

Return to bug 197379