FreeBSD Bugzilla – Attachment 152635 Details for
Bug 197379
[PATCH] Add an option to run `syslogd' in the foreground
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Add a '-F' option to make `syslogd' run in the foreground
foreground-syslogd.patch (text/plain), 2.12 KB, created by
Ravi Pokala
on 2015-02-06 19:45:05 UTC
(
hide
)
Description:
Add a '-F' option to make `syslogd' run in the foreground
Filename:
MIME Type:
Creator:
Ravi Pokala
Created:
2015-02-06 19:45:05 UTC
Size:
2.12 KB
patch
obsolete
>Index: usr.sbin/syslogd/syslogd.8 >=================================================================== >--- usr.sbin/syslogd/syslogd.8 (revision 278326) >+++ usr.sbin/syslogd/syslogd.8 (working copy) >@@ -36,7 +36,7 @@ > .Nd log systems messages > .Sh SYNOPSIS > .Nm >-.Op Fl 468ACcdkNnosTuv >+.Op Fl 468ACcdFkNnosTuv > .Op Fl a Ar allowed_peer > .Op Fl b Ar bind_address > .Op Fl f Ar config_file >@@ -213,6 +213,17 @@ > Specify the pathname of an alternate configuration file; > the default is > .Pa /etc/syslog.conf . >+.It Fl F >+Run >+.Nm >+in the foreground, rather than going into daemon mode. This is useful if >+some other process uses >+.Xr fork 2 >+and >+.Xr exec 3 >+to run >+.Nm , >+and wants to monitor when and how it exits. > .It Fl k > Disable the translation of > messages received with facility >Index: usr.sbin/syslogd/syslogd.c >=================================================================== >--- usr.sbin/syslogd/syslogd.c (revision 278326) >+++ usr.sbin/syslogd/syslogd.c (working copy) >@@ -271,6 +271,7 @@ > static struct filed consfile; /* Console */ > > static int Debug; /* debug flag */ >+static int Foreground = 0; /* Run in foreground, instead of daemonizing */ > static int resolve = 1; /* resolve hostname */ > static char LocalHostName[MAXHOSTNAMELEN]; /* our hostname */ > static const char *LocalDomain; /* our local domain name */ >@@ -360,7 +361,7 @@ > dprintf("madvise() failed: %s\n", strerror(errno)); > > bindhostname = NULL; >- while ((ch = getopt(argc, argv, "468Aa:b:cCdf:kl:m:nNop:P:sS:Tuv")) >+ while ((ch = getopt(argc, argv, "468Aa:b:cCdf:Fkl:m:nNop:P:sS:Tuv")) > != -1) > switch (ch) { > case '4': >@@ -396,6 +397,9 @@ > case 'f': /* configuration file */ > ConfFile = optarg; > break; >+ case 'F': /* run in foreground instead of daemon */ >+ Foreground++; >+ break; > case 'k': /* keep remote kern fac */ > KeepKernFac = 1; > break; >@@ -487,14 +491,14 @@ > warn("cannot open pid file"); > } > >- if (!Debug) { >+ if ((!Foreground) && (!Debug)) { > ppid = waitdaemon(0, 0, 30); > if (ppid < 0) { > warn("could not become daemon"); > pidfile_remove(pfh); > exit(1); > } >- } else { >+ } else if (Debug) { > setlinebuf(stdout); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 197379
: 152635