+static void handleKillSignal(int signo) {
+ /* we are the top-level process and we've been
+ * killed. Kill all of our children */
+ kill(0, SIGTERM);
+ sleep(1); /* give the children a chance to die before we reap them */
+ pid_t child_pid;
+ int status;
+ while( (child_pid=waitpid(-1,&status,WNOHANG)) > 0)
+ osrfLogInfo(OSRF_LOG_MARK, "Killed child %d", child_pid);
+ _exit(0);
+}
+
+