Sync proc.c with httpd. httpd needs SIGUSR1 but iked will ignore it
authorreyk <reyk@openbsd.org>
Mon, 18 Aug 2014 09:43:02 +0000 (09:43 +0000)
committerreyk <reyk@openbsd.org>
Mon, 18 Aug 2014 09:43:02 +0000 (09:43 +0000)
now instead of terminating the process.

ok mikeb@

sbin/iked/iked.c
sbin/iked/iked.h
sbin/iked/proc.c

index 68a13b2..22bc0c5 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: iked.c,v 1.21 2014/05/08 13:11:16 blambert Exp $      */
+/*     $OpenBSD: iked.c,v 1.22 2014/08/18 09:43:02 reyk Exp $  */
 
 /*
  * Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -160,12 +160,14 @@ main(int argc, char *argv[])
        signal_set(&ps->ps_evsigchld, SIGCHLD, parent_sig_handler, ps);
        signal_set(&ps->ps_evsighup, SIGHUP, parent_sig_handler, ps);
        signal_set(&ps->ps_evsigpipe, SIGPIPE, parent_sig_handler, ps);
+       signal_set(&ps->ps_evsigusr1, SIGUSR1, parent_sig_handler, ps);
 
        signal_add(&ps->ps_evsigint, NULL);
        signal_add(&ps->ps_evsigterm, NULL);
        signal_add(&ps->ps_evsigchld, NULL);
        signal_add(&ps->ps_evsighup, NULL);
        signal_add(&ps->ps_evsigpipe, NULL);
+       signal_add(&ps->ps_evsigusr1, NULL);
 
        proc_listen(ps, procs, nitems(procs));
 
@@ -279,6 +281,9 @@ parent_sig_handler(int sig, short event, void *arg)
        case SIGPIPE:
                log_info("%s: ignoring SIGPIPE", __func__);
                break;
+       case SIGUSR1:
+               log_info("%s: ignoring SIGUSR1", __func__);
+               break;
        case SIGTERM:
        case SIGINT:
                die = 1;
index 0e240f6..ad1e981 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: iked.h,v 1.81 2014/05/09 06:37:24 markus Exp $        */
+/*     $OpenBSD: iked.h,v 1.82 2014/08/18 09:43:02 reyk Exp $  */
 
 /*
  * Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -532,6 +532,7 @@ struct privsep {
        struct event                     ps_evsigchld;
        struct event                     ps_evsighup;
        struct event                     ps_evsigpipe;
+       struct event                     ps_evsigusr1;
 
        struct iked                     *ps_env;
 };
index 5fc1b6f..fac0f9e 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: proc.c,v 1.18 2014/07/12 14:15:04 reyk Exp $  */
+/*     $OpenBSD: proc.c,v 1.19 2014/08/18 09:43:02 reyk Exp $  */
 
 /*
  * Copyright (c) 2010 - 2014 Reyk Floeter <reyk@openbsd.org>
@@ -38,8 +38,6 @@
 #include <pwd.h>
 #include <event.h>
 
-#include <openssl/ssl.h>
-
 #include "iked.h"
 
 void    proc_open(struct privsep *, struct privsep_proc *,
@@ -163,7 +161,7 @@ proc_open(struct privsep *ps, struct privsep_proc *p,
 
        /*
         * Open socket pairs for our peers
-        */     
+        */
        for (proc = 0; proc < nproc; proc++) {
                procs[proc].p_ps = ps;
                procs[proc].p_env = ps->ps_env;
@@ -323,6 +321,7 @@ proc_sig_handler(int sig, short event, void *arg)
        case SIGCHLD:
        case SIGHUP:
        case SIGPIPE:
+       case SIGUSR1:
                /* ignore */
                break;
        default:
@@ -409,12 +408,14 @@ proc_run(struct privsep *ps, struct privsep_proc *p,
        signal_set(&ps->ps_evsigchld, SIGCHLD, proc_sig_handler, p);
        signal_set(&ps->ps_evsighup, SIGHUP, proc_sig_handler, p);
        signal_set(&ps->ps_evsigpipe, SIGPIPE, proc_sig_handler, p);
+       signal_set(&ps->ps_evsigusr1, SIGUSR1, proc_sig_handler, p);
 
        signal_add(&ps->ps_evsigint, NULL);
        signal_add(&ps->ps_evsigterm, NULL);
        signal_add(&ps->ps_evsigchld, NULL);
        signal_add(&ps->ps_evsighup, NULL);
        signal_add(&ps->ps_evsigpipe, NULL);
+       signal_add(&ps->ps_evsigusr1, NULL);
 
        proc_listen(ps, procs, nproc);