summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorCan Erkin Acar <canacar@cvs.openbsd.org>2007-04-06 16:30:50 +0000
committerCan Erkin Acar <canacar@cvs.openbsd.org>2007-04-06 16:30:50 +0000
commit013f5cd9c7af96ff380d4096829408c9f22977ca (patch)
tree88f0a0280a78f08810364ddf07f12bb736112802 /sbin
parent99c7a2ababa46688821650b6ec4f1420cabeab37 (diff)
Adds a pidfile argument to pflogd so that individual
instances can be rotated via newsyslog. From Berk Demir < bdd at mindcast org > ok henning@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/pflogd/pflogd.89
-rw-r--r--sbin/pflogd/pflogd.c10
2 files changed, 15 insertions, 4 deletions
diff --git a/sbin/pflogd/pflogd.8 b/sbin/pflogd/pflogd.8
index cbb7802419e..c1512ca8912 100644
--- a/sbin/pflogd/pflogd.8
+++ b/sbin/pflogd/pflogd.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: pflogd.8,v 1.32 2006/12/08 10:26:38 joel Exp $
+.\" $OpenBSD: pflogd.8,v 1.33 2007/04/06 16:30:49 canacar Exp $
.\"
.\" Copyright (c) 2001 Can Erkin Acar. All rights reserved.
.\"
@@ -36,6 +36,7 @@
.Op Fl d Ar delay
.Op Fl f Ar filename
.Op Fl i Ar interface
+.Op Fl p Ar pidfile
.Op Fl s Ar snaplen
.Op Ar expression
.Sh DESCRIPTION
@@ -106,6 +107,12 @@ If not specified, the default is 60 seconds.
Log output filename.
Default is
.Pa /var/log/pflog .
+.It Fl p Ar pidname
+Writes a file containing the process ID of the program.
+The file name has the form
+.Pa /var/run/pidname.pid .
+If the option is not given, pidname name defaults to
+.Pa pflogd .
.It Fl i Ar interface
Specifies the
.Xr pflog 4
diff --git a/sbin/pflogd/pflogd.c b/sbin/pflogd/pflogd.c
index 168deb12edd..df8271fd585 100644
--- a/sbin/pflogd/pflogd.c
+++ b/sbin/pflogd/pflogd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pflogd.c,v 1.37 2006/10/26 13:34:47 jmc Exp $ */
+/* $OpenBSD: pflogd.c,v 1.38 2007/04/06 16:30:49 canacar Exp $ */
/*
* Copyright (c) 2001 Theo de Raadt
@@ -531,10 +531,11 @@ main(int argc, char **argv)
int ch, np, Xflag = 0;
pcap_handler phandler = dump_packet;
const char *errstr = NULL;
+ char *pidf = NULL;
closefrom(STDERR_FILENO + 1);
- while ((ch = getopt(argc, argv, "Dxd:f:i:s:")) != -1) {
+ while ((ch = getopt(argc, argv, "Dxd:f:i:p:s:")) != -1) {
switch (ch) {
case 'D':
Debug = 1;
@@ -550,6 +551,9 @@ main(int argc, char **argv)
case 'i':
interface = optarg;
break;
+ case 'p':
+ pidf = optarg;
+ break;
case 's':
snaplen = strtonum(optarg, 0, PFLOGD_MAXSNAPLEN,
&errstr);
@@ -577,7 +581,7 @@ main(int argc, char **argv)
logmsg(LOG_WARNING, "Failed to become daemon: %s",
strerror(errno));
}
- pidfile(NULL);
+ pidfile(pidf);
}
tzset();