On Sun, Aug 2, 2009 at 18:00, imfeldma@xxxxxxxxx <imfeldma@xxxxxxxxx> wrote: > I'm trying to temporarily fork off a daemon (BIND's named) within a > testsuite. Yet the testsuite hangs despite having started the daemon. Below > is an excerpt of the circumstances. Running testsuite -v shows that the hang > occurs not as one would assume during the fork of the daemon but in the > subsequent check for its pid. This occurs both when making the daemon > startup a separate AT_CHECK item as well as when making it a simple shell > statement. However, named starts properly and, since I'm not killing it for > now, continues to run past SIGINT of the test suite . > > I understand that things enclosed between AT_SETUP and AT_CLEANUP run > within their own subshell hence my plan was to start named, do some tests > and kill it within those two. Could it be that named is capturing > stdout/stderr irretrievably away from autotest or is forking generally a > problem? In my testing of Nagios/LDAP, I created a tool similar to "nohup"; instead of changing signal-handling, I made "timeout" to kill the child process after a given delay, giving a return code based on what cases/reasons it stopped. I'm using this in MySQLfs (http://sourceforge.net/projects/mysqlfs/develop) -- you can grab a copy from the mysqlfs/tests-autotest/timeout.c. Check the Makefile.am, you'll see that I cheat the dependencies to make sure "timeout" is created before running the test: --- check-local: atconfig atlocal $(TESTSUITE) timeout $(SHELL) $(TESTSUITE) rm -fr $(subdir)/testsuite.dir check_PROGRAMS = timeout timeout_SOURCES = timeout.c --- I get pretty good results from this, but it occasionally "timeout" isn't aggressive enough in failed tests (and it's timeout expires, and it goes on a killing spree). in Nagios/LDAP, I kill the timeout by pidfile mentioned in the ldap config; in MySQLfs, I got weak, and I just killall. I could probably write out the pidfile from timeout's fork() for better/safer assassination. Doxygen'd at http://mysqlfs.sourceforge.net/html/timeout_8c-source.html . GPL2 Allan -- allanc@xxxxxxxxxxxxxxxxxx "金鱼" http://linkedin.com/in/goldfish _______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf