Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Oct 2005 12:24:43 GMT
From:      Sergey Svishchev <svs+pr@grep.ru>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/87981: ipmon writes pid file even when not in daemon mode
Message-ID:  <200510251224.j9PCOhDT062013@www.freebsd.org>
Resent-Message-ID: <200510251230.j9PCUDLm083906@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         87981
>Category:       bin
>Synopsis:       ipmon writes pid file even when not in daemon mode
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 25 12:30:13 GMT 2005
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200510251224.j9PCOhDT062013>