Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Mar 2006 00:29:09 +0700 (KRAT)
From:      Eugene Grosbein <eugen@grosbein.pp.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        romanp@unshadow.net, skv@FreeBSD.org
Subject:   ports/94485: ipacctd may miss signals
Message-ID:  <200603151729.k2FHT9vF002549@grosbein.pp.ru>
Resent-Message-ID: <200603151730.k2FHUODb097196@freefall.freebsd.org>

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

>Number:         94485
>Category:       ports
>Synopsis:       ipacctd may miss signals
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 15 17:30:24 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Eugene Grosbein
>Release:        FreeBSD 4.11-STABLE i386
>Organization:
Svyaz Service JSC
>Environment:
System: FreeBSD grosbein.pp.ru 4.11-STABLE FreeBSD 4.11-STABLE #3: Tue Feb 28 11:03:53 KRAT 2006 eu@grosbein.pp.ru:/usr/local/obj/usr/local/src/sys/DADV i386
	ipacctd-1.46_1

>Description:
	A kernel does not deliver signals to ipacctd
	when its parent has masked signals before starting ipacctd.
	For example, this is a case for mpd and its ip-up scripts.

>How-To-Repeat:
	Run ipacctd using scripts that mpd invokes when an interface comes up.
	ipacctd will run with some signals being masked out.

>Fix:

	ipacctd should unmask signals it expects to catch.
	Here is ports/net-mgmt/ipacctd/files/patch-sigunmask
	implementing this behavour.

--- src/ipacctd.c.orig	Wed Mar 15 21:36:48 2006
+++ src/ipacctd.c	Wed Mar 15 21:53:09 2006
@@ -138,6 +138,7 @@
 	fd_set 	allsocks;
 	struct 	ip *ip;
 	struct 	acct rec;
+	sigset_t set;
     
 	bzero(&ds, size_ds);
 	max_nrecords = MAX_NRECORDS;
@@ -198,6 +199,12 @@
 	}
 
 	/* signal handling */
+	sigemptyset(&set);
+	sigaddset(&set, SIGTERM);
+	sigaddset(&set, SIGHUP);
+	sigaddset(&set, SIGUSR2);
+	sigprocmask(SIG_UNBLOCK, &set, NULL);
+	
 	if (signal(SIGTERM, catch_signal) == SIG_ERR)
 		err(1, "signal(SIGTERM)");
 	if (!flag_server)



Eugene Grosbein
>Release-Note:
>Audit-Trail:
>Unformatted:



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