From nobody@FreeBSD.org  Tue Oct 25 12:24:44 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id DE55E16A41F
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 25 Oct 2005 12:24:44 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id A4AD843D4C
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 25 Oct 2005 12:24:44 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j9PCOimJ062014
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 25 Oct 2005 12:24:44 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j9PCOhDT062013;
	Tue, 25 Oct 2005 12:24:43 GMT
	(envelope-from nobody)
Message-Id: <200510251224.j9PCOhDT062013@www.freebsd.org>
Date: Tue, 25 Oct 2005 12:24:43 GMT
From: Sergey Svishchev <svs+pr@grep.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ipmon writes pid file even when not in daemon mode
X-Send-Pr-Version: www-2.3

>Number:         87981
>Category:       bin
>Synopsis:       [patch] ipmon(8) writes pid file even when not in daemon mode
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    darrenr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 25 12:30:13 GMT 2005
>Closed-Date:    Sat Oct 27 16:42:03 UTC 2007
>Last-Modified:  Sat Oct 27 16:42:03 UTC 2007
>Originator:     Sergey Svishchev
>Release:        5.2.1
>Organization:
>Environment:
>Description:
ipmon is supposed to write its PID to /var/run/ipmon.pid only when it is running as daemon; however, it does that even if -D is not specified.

Consequently, if newsyslog is configured to rotate ipmon's log file and notify ipmon afterwards, it is unable to do so, since pid file contains wrong PID.
>How-To-Repeat:

>Fix:
--- ipmon.c.orig	2005-07-25 14:34:05.379137800 +0400
+++ ipmon.c	2005-07-25 14:23:16.000000000 +0400
@@ -1417,8 +1417,8 @@
 #endif /* !BSD */
 		close(0);
 		close(1);
+		write_pid(pidfile);
 	}
-	write_pid(pidfile);
 
 	signal(SIGHUP, handlehup);
 

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->darrenr 
Responsible-Changed-By: kris 
Responsible-Changed-When: Tue Oct 25 18:40:46 GMT 2005 
Responsible-Changed-Why:  
Assign to ipfilter author 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87981 
State-Changed-From-To: open->feedback 
State-Changed-By: darrenr 
State-Changed-When: Mon Feb 27 09:25:05 UTC 2006 
State-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=87981 
State-Changed-From-To: feedback->closed 
State-Changed-By: darrenr 
State-Changed-When: Sat Oct 27 16:41:49 UTC 2007 
State-Changed-Why:  
change committed to RELENG_5 branch 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87981 
>Unformatted:
