diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2016-11-13 09:48:56 +0100 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2017-03-08 00:15:36 +0100 |
commit | eb05883f3ecd94be017eb7d15181a989f26541ee (patch) | |
tree | f3de680c33e3af0f95520eadf8fb0060dc1ee76c /watchfrr | |
parent | *: centralize more into frr_init() (diff) | |
download | frr-eb05883f3ecd94be017eb7d15181a989f26541ee.tar.xz frr-eb05883f3ecd94be017eb7d15181a989f26541ee.zip |
*: add frr_config_fork()
Centralise read_config/daemonize/dryrun/pidfile/vty_serv into libfrr.
This also makes multi-instance pid/config handling available as part of
the library. It's only wired up in ospfd, but the code is in lib/.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'watchfrr')
-rw-r--r-- | watchfrr/watchfrr.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/watchfrr/watchfrr.c b/watchfrr/watchfrr.c index a09ec5225..3bf2783ee 100644 --- a/watchfrr/watchfrr.c +++ b/watchfrr/watchfrr.c @@ -1022,7 +1022,8 @@ static struct quagga_signal_t watchfrr_signals[] = { }; FRR_DAEMON_INFO(watchfrr, WATCHFRR, - .flags = FRR_NO_PRIVSEP | FRR_NO_TCPVTY | FRR_LIMITED_CLI, + .flags = FRR_NO_PRIVSEP | FRR_NO_TCPVTY | FRR_LIMITED_CLI + | FRR_NO_CFG_PID_DRY | FRR_NO_ZCLIENT, .printhelp = printhelp, .copyright = "Copyright 2004 Andrew J. Schorr", @@ -1036,7 +1037,6 @@ FRR_DAEMON_INFO(watchfrr, WATCHFRR, int main(int argc, char **argv) { int opt; - int daemon_mode = 0; const char *pidfile = DEFAULT_PIDFILE; const char *special = "zebra"; const char *blankstr = NULL; @@ -1072,9 +1072,6 @@ int main(int argc, char **argv) case 'b': blankstr = optarg; break; - case 'd': - daemon_mode = 1; - break; case 'e': gs.do_ping = 0; break; @@ -1278,7 +1275,7 @@ int main(int argc, char **argv) master = frr_init(); zlog_set_level(NULL, ZLOG_DEST_MONITOR, ZLOG_DISABLED); - if (daemon_mode) { + if (watchfrr_di.daemon_mode) { zlog_set_level(NULL, ZLOG_DEST_SYSLOG, MIN(gs.loglevel, LOG_DEBUG)); if (daemon (0, 0) < 0) { fprintf(stderr, "Watchquagga daemon failed: %s", @@ -1290,7 +1287,7 @@ int main(int argc, char **argv) watchfrr_vty_init(); - frr_vty_serv(WATCHFRR_VTYSH_PATH); + frr_vty_serv(); { int i; |