diff options
author | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2007-06-19 14:42:10 +0000 |
---|---|---|
committer | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2007-06-19 14:42:10 +0000 |
commit | ff30074cd65a4f50242e8e41615d9cd13d182986 (patch) | |
tree | d0a4bf57f34ec9bb62714d4cfe4f3c3a7ec0c25f | |
parent | b87e21b77c7933ec2c6b689122772684efd204f2 (diff) |
Allow ospfd reconfiguration through SIGHUP, add SIGHUP handlers in
children like in bgpd so that ``pkill -1 ospfd'' works as expected.
ok claudio@
-rw-r--r-- | usr.sbin/ospfd/ospfd.c | 8 | ||||
-rw-r--r-- | usr.sbin/ospfd/ospfe.c | 3 | ||||
-rw-r--r-- | usr.sbin/ospfd/rde.c | 3 |
3 files changed, 9 insertions, 5 deletions
diff --git a/usr.sbin/ospfd/ospfd.c b/usr.sbin/ospfd/ospfd.c index e71744f1119..523b6367792 100644 --- a/usr.sbin/ospfd/ospfd.c +++ b/usr.sbin/ospfd/ospfd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfd.c,v 1.46 2007/05/29 22:08:25 claudio Exp $ */ +/* $OpenBSD: ospfd.c,v 1.47 2007/06/19 14:42:09 pyr Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -103,8 +103,10 @@ main_sig_handler(int sig, short event, void *arg) ospfd_shutdown(); break; case SIGHUP: - /* reconfigure */ - /* ... */ + if (ospf_reload() == -1) + log_warnx("configuration reload failed"); + else + log_debug("configuration reloaded"); break; default: fatalx("unexpected signal"); diff --git a/usr.sbin/ospfd/ospfe.c b/usr.sbin/ospfd/ospfe.c index 90c30d427d4..8e831593dcd 100644 --- a/usr.sbin/ospfd/ospfe.c +++ b/usr.sbin/ospfd/ospfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfe.c,v 1.55 2007/05/29 22:08:25 claudio Exp $ */ +/* $OpenBSD: ospfe.c,v 1.56 2007/06/19 14:42:09 pyr Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -136,6 +136,7 @@ ospfe(struct ospfd_conf *xconf, int pipe_parent2ospfe[2], int pipe_ospfe2rde[2], signal_add(&ev_sigint, NULL); signal_add(&ev_sigterm, NULL); signal(SIGPIPE, SIG_IGN); + signal(SIGHUP, SIG_IGN); /* setup pipes */ close(pipe_parent2ospfe[0]); diff --git a/usr.sbin/ospfd/rde.c b/usr.sbin/ospfd/rde.c index 1c0ad91bb52..aa9a09aa5ab 100644 --- a/usr.sbin/ospfd/rde.c +++ b/usr.sbin/ospfd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.66 2007/04/11 07:09:15 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.67 2007/06/19 14:42:09 pyr Exp $ */ /* * Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org> @@ -137,6 +137,7 @@ rde(struct ospfd_conf *xconf, int pipe_parent2rde[2], int pipe_ospfe2rde[2], signal_add(&ev_sigint, NULL); signal_add(&ev_sigterm, NULL); signal(SIGPIPE, SIG_IGN); + signal(SIGHUP, SIG_IGN); /* setup pipes */ close(pipe_ospfe2rde[0]); |