-.\" $OpenBSD: syslogd.8,v 1.33 2015/01/30 14:09:49 bluhm Exp $
+.\" $OpenBSD: syslogd.8,v 1.34 2015/06/15 21:42:15 bluhm Exp $
.\"
.\" Copyright (c) 1983, 1986, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\" from: @(#)syslogd.8 8.1 (Berkeley) 6/6/93
.\" $NetBSD: syslogd.8,v 1.3 1996/01/02 17:41:48 perry Exp $
.\"
-.Dd $Mdocdate: January 30 2015 $
+.Dd $Mdocdate: June 15 2015 $
.Dt SYSLOGD 8
.Os
.Sh NAME
.Sh SYNOPSIS
.Nm syslogd
.Bk -words
-.Op Fl 46dhnuV
+.Op Fl 46dFhnuV
.Op Fl a Ar path
.Op Fl C Ar CAfile
.Op Fl f Ar config_file
Specify the pathname of an alternate configuration file;
the default is
.Pa /etc/syslog.conf .
+.It Fl F
+Run in the foreground instead of disassociating from the controlling
+terminal and running as a background daemon.
.It Fl h
Include the hostname when forwarding messages to a remote host.
.It Fl m Ar mark_interval
-/* $OpenBSD: syslogd.c,v 1.163 2015/06/12 19:20:43 bluhm Exp $ */
+/* $OpenBSD: syslogd.c,v 1.164 2015/06/15 21:42:15 bluhm Exp $ */
/*
* Copyright (c) 1983, 1988, 1993, 1994
int nunix = 1; /* Number of Unix domain sockets requested */
char *path_unix[MAXUNIX] = { _PATH_LOG }; /* Paths to Unix domain sockets */
int Debug; /* debug flag */
+int Foreground; /* run in foreground, instead of daemonizing */
int Startup = 1; /* startup flag */
char LocalHostName[HOST_NAME_MAX+1]; /* our hostname */
char *LocalDomain; /* our local domain name */
int ch, i;
int lockpipe[2] = { -1, -1}, pair[2], nullfd, fd;
- while ((ch = getopt(argc, argv, "46C:dhnuf:m:p:a:s:V")) != -1)
+ while ((ch = getopt(argc, argv, "46C:dhnuf:Fm:p:a:s:V")) != -1)
switch (ch) {
case '4': /* disable IPv6 */
IPv4Only = 1;
case 'f': /* configuration file */
ConfFile = optarg;
break;
+ case 'F': /* foreground */
+ Foreground = 1;
+ break;
case 'h': /* RFC 3164 hostnames */
IncludeHostname = 1;
break;
tzset();
- if (!Debug) {
+ if (!Debug && !Foreground) {
char c;
pipe(lockpipe);
{
(void)fprintf(stderr,
- "usage: syslogd [-46dhnuV] [-a path] [-C CAfile] [-f config_file]\n"
+ "usage: syslogd [-46dFhnuV] [-a path] [-C CAfile] [-f config_file]\n"
" [-m mark_interval] [-p log_socket] [-s reporting_socket]\n");
exit(1);
}