summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2014-08-18 09:43:03 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2014-08-18 09:43:03 +0000
commitf4a3e83bbd892539a6a78f3828f0561f8c084658 (patch)
treeca6be741da1843cdbcb7e2f9ac0a7cb76ad1cf34 /sbin
parent1f9d49e4b6bac3b7cc8f73f8a9b741900e73c475 (diff)
Sync proc.c with httpd. httpd needs SIGUSR1 but iked will ignore it
now instead of terminating the process. ok mikeb@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/iked/iked.c7
-rw-r--r--sbin/iked/iked.h3
-rw-r--r--sbin/iked/proc.c9
3 files changed, 13 insertions, 6 deletions
diff --git a/sbin/iked/iked.c b/sbin/iked/iked.c
index 68a13b2fdd5..22bc0c5aec8 100644
--- a/sbin/iked/iked.c
+++ b/sbin/iked/iked.c
@@ -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;
diff --git a/sbin/iked/iked.h b/sbin/iked/iked.h
index 0e240f62748..ad1e9818489 100644
--- a/sbin/iked/iked.h
+++ b/sbin/iked/iked.h
@@ -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;
};
diff --git a/sbin/iked/proc.c b/sbin/iked/proc.c
index 5fc1b6fdac9..fac0f9e7792 100644
--- a/sbin/iked/proc.c
+++ b/sbin/iked/proc.c
@@ -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);