Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Dec 1998 11:17:35 +0100 (MET)
From:      Nick Hibma <nick.hibma@jrc.it>
To:        cwt@FreeBSD.ORG, FreeBSD current mailing list <freebsd-current@FreeBSD.ORG>, Amanda Hackers List <amanda-hackers@cs.umd.edu>
Subject:   sigchild breakage on FreeBSD
Message-ID:  <Pine.GSO.3.95q.981217104939.889T-100000@elect8>

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

AmandaD (amanda backup software) is broken on FreeBSD-Current as of
revision 1.42 of src/usr.sbin/inetd/inetd.c. This fix is posted to
FreeBSD current because other packages might be broken for the same
reason and the same sort of fix might apply. Chris, it might be useful
to add this patch until the patch has been considered by the Amanda
group. 



Description:

When running amcheck -c <config> on the client machine a zombie
(selfcheck) is created. This indicates that the mother, amandad,
started through inetd, does not accept the sigchild signal. The zombie
stays there until either the mother accepts that signal or dies.


Applicability:

FreeBSD-CURRENT as of revision 1.42 of src/usr.sbin/inetd.c.


Amanda version:
-rw-r--r--  1 404  601  14117 Jul  4 01:44 amandad.c
amanda-2.4.1
(no patches applied, no patches found that looked applicable)


Problem:

inetd switches off sigchild somewhere before execing the child. Amandad
does not do an extra fork to separate itself from the mother, so it
inherits that blocked sigCHILD.

Solution:

One of the options below:
1) Switch signal back on (see fix)
2) Do an extra fork (not checked whether this works)


Fix:

The fix switches the SigCHILD signal back on (is switched off by inetd.c
in revision 1.42).

--- amandad.c   Sat Jul  4 01:44:41 1998
+++ amandad.c.new       Thu Dec 17 10:41:45 1998
@@ -116,6 +116,9 @@
     char *errstr = NULL;
     unsigned long malloc_hist_1, malloc_size_1;
     unsigned long malloc_hist_2, malloc_size_2;
+#ifdef __FreeBSD__
+    sigset_t set;
+#endif
 
     for(fd = 3; fd < FD_SETSIZE; fd++) {
        /*
@@ -313,6 +316,11 @@
 
     /* spawn child to handle request */
 
+#ifdef __FreeBSD__
+    sigemptyset(&set);
+    sigaddset(&set, SIGCHLD);
+    sigprocmask(SIG_UNBLOCK, &set, NULL);
+#endif
     signal(SIGCHLD, sigchild_flag);
 
     switch(fork()) {


Cheers, Nick
-- 
ISIS/STA, T.P.270, Joint Research Centre, 21020 Ispra, Italy


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.3.95q.981217104939.889T-100000>