what became of pflogd -p pidfile?
Hi folks, Problem: For rotating pflog log files I need the PID of the appropriate pflogd. For 4.3 I could rely upon pflogd -p pflogd4.pid, but for 4.8 the -p is not allowed anymore :-(. The man page still points to newsyslog, but thats all. Of course this can be solved by messing around with pgrep or pkill, but for several pflog files this gets _really_ ugly, not to mention that newsyslog doesn't accept a script to compute the PID. Why was the -p dropped? Is there any chance to get it back? Regards Harri
Re: what became of pflogd -p pidfile?
On Thu, Jan 27, 2011 at 01:45:30PM +0100, Harald Dunkel wrote: Hi folks, Problem: For rotating pflog log files I need the PID of the appropriate pflogd. For 4.3 I could rely upon pflogd -p pflogd4.pid, but for 4.8 the -p is not allowed anymore :-(. The man page still points to newsyslog, but thats all. Of course this can be solved by messing around with pgrep or pkill, but for several pflog files this gets _really_ ugly, not to mention that newsyslog doesn't accept a script to compute the PID. Why was the -p dropped? Is there any chance to get it back? Regards Harri -p is prone to race conditions. I don't think there's any drawback in sending all pflogd instances a HUP. Check the example newsyslog.conf that comes with the install. -Otto
Re: what became of pflogd -p pidfile?
On 01/27/11 14:01, Otto Moerbeek wrote: -p is prone to race conditions. A race condition on writing a pid file in main()? It would be very interesting to get more details about this. Regards Harri
Re: what became of pflogd -p pidfile?
On Thu, Jan 27, 2011 at 03:08:32PM +0100, Harald Dunkel wrote: On 01/27/11 14:01, Otto Moerbeek wrote: -p is prone to race conditions. A race condition on writing a pid file in main()? It would be very interesting to get more details about this. Regards Harri in genreal, when things go wrong, a pid file might remain. That file does not reflect the pid of a pflogd daemon. You might be sending a HUP to the wrong process. A race condition occurs when pflogd is restarted, and in the meantime a process reads the pid file to send a HUP or other signal. -Otto
Re: what became of pflogd -p pidfile?
On 01/27/11 15:37, Otto Moerbeek wrote: in genreal, when things go wrong, a pid file might remain. That file does not reflect the pid of a pflogd daemon. You might be sending a HUP to the wrong process. A race condition occurs when pflogd is restarted, and in the meantime a process reads the pid file to send a HUP or other signal. I was concerned that this problem is specific to pflogd. Many thanx Harri