diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-04-25 17:34:35 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-04-27 22:04:48 +0200 |
commit | 651415bd617af87ee0addfc15d6985b6946600ed (patch) | |
tree | 2a3f537c22a68dae1e554f8a4de5be1a1394a9d5 /watchquagga | |
parent | Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga in... (diff) | |
download | frr-651415bd617af87ee0addfc15d6985b6946600ed.tar.xz frr-651415bd617af87ee0addfc15d6985b6946600ed.zip |
quagga: Fixup startup to allow consistency between sysV and systemd
We want the ability to start up quagga in a varied set of
environments. This needs to be done in SysV and systemd
startups. As such refactor the code to allow us to
allow end users to easily switch between the two
sysV:
edit the /etc/quagga/daemons file
service quagga [start|stop|reload|restart]
Systemd:
edit the /etc/quagga/daemons file
systemctl [start|stop|reload|restart] quagga
Ticket: CM-10634
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Diffstat (limited to 'watchquagga')
-rw-r--r-- | watchquagga/watchquagga.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/watchquagga/watchquagga.c b/watchquagga/watchquagga.c index 0cc2b46a3..36c833821 100644 --- a/watchquagga/watchquagga.c +++ b/watchquagga/watchquagga.c @@ -28,6 +28,7 @@ #include <sys/un.h> #include <sys/wait.h> #include <memory.h> +#include <systemd.h> #ifndef MIN #define MIN(X,Y) (((X) <= (Y)) ? (X) : (Y)) @@ -985,6 +986,7 @@ static void sigint(void) { zlog_notice("Terminating on signal"); + systemd_send_stopping (); exit(0); } @@ -1275,6 +1277,7 @@ main(int argc, char **argv) gs.restart.interval = gs.min_restart_interval; master = thread_master_create(); + systemd_send_started (master, 0); signal_init (master, array_size(my_signals), my_signals); srandom(time(NULL)); @@ -1374,6 +1377,7 @@ main(int argc, char **argv) thread_call (&thread); } + systemd_send_stopping (); /* Not reached. */ return 0; } |