summaryrefslogtreecommitdiffstats
path: root/watchfrr (follow)
Commit message (Collapse)AuthorAgeFilesLines
* watchfrr: fix global restartChristian Franke2018-08-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | watchfrr needs to handle a SIGCHLD also when it calls a global restart command. Before this patch, it would lead to the following behavior: 15:44:28: zebra state -> down : unexpected read error: Connection reset by peer 15:44:33: Forked background command [pid 6392]: /usr/sbin/frr.init watchrestart all 15:44:53: Warning: restart all child process 6392 still running after 20 seconds, sending signal 15 15:44:53: waitpid returned status for an unknown child process 6392 15:44:53: background (unknown) process 6392 terminated due to signal 15 15:45:13: Warning: restart all child process 6392 still running after 40 seconds, sending signal 9 15:45:33: Warning: restart all child process 6392 still running after 60 seconds, sending signal 9 15:45:53: Warning: restart all child process 6392 still running after 80 seconds, sending signal 9 15:46:13: Warning: restart all child process 6392 still running after 100 seconds, sending signal 9 15:46:33: Warning: restart all child process 6392 still running after 120 seconds, sending signal 9 15:46:53: Warning: restart all child process 6392 still running after 140 seconds, sending signal 9 This is obviously incorrect and can be fixed by comparing the pid to the global restart object as well. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
* *: rename ferr_zlog -> flog_err_sysQuentin Young2018-08-141-27/+28
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: rename ferr_ref -> log_refQuentin Young2018-08-142-3/+3
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: rename zlog_fer -> flog_errQuentin Young2018-08-141-14/+14
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: stop double initialization of ferrQuentin Young2018-08-141-2/+0
| | | | | | | | * Stop double init of ferr * Fixup bugs in zebra ferr * Add missing init in ospfd Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: fix source file headers & includes for errcodesQuentin Young2018-08-142-21/+23
| | | | | | | | | | * Use the correct license header * Stop headers from including themselves * Use uniform relative include conventions * Ensure that sources include what they use * Turn off clang-format around struct array blocks Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* watchfrr: Add WATCHFRR_ERR_XXX for zlog_err to zlog_ferrDonald Sharp2018-08-144-32/+123
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* watchfrr, vtysh: do not write config during crashQuentin Young2018-03-213-1/+31
| | | | | | | | | | | | | | | | | If a daemon is restarting, crashed, or otherwise in the process of reconnecting to watchfrr and a user issues "write memory" or "write file" the resulting config will not include the configuration of that daemon. This is problematic because this output will overwrite the previous config, potentially causing unintentional loss of configuration stored only in the config file based upon timing. This patch remedies that by making watchfrr check that all daemons are up before attempting a configuration write, and updating vtysh so that its failsafe respects this condition as well. Note that this issue only manifests when using integrated config. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Merge pull request #1514 from donaldsharp/watchfrrMartin Winter2017-12-121-1/+1
|\ | | | | tools, watchfrr: Modify timeout to 90 seconds
| * tools, watchfrr: Modify timeout to 90 secondsBrian Rak2017-12-041-1/+1
| | | | | | | | | | | | | | | | The default timeout of 10 seconds is too quick of a timeout given some long running cli commands. Modify watchfrr to have a 90s timeout value instead. Signed-off-by: Brian Rak <brianrak@gameservers.com>
* | watchfrr: Fail gracefully if fopen failsDonald Sharp2017-12-051-1/+2
|/ | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: watchfrr needs 'show debugging' DEFUNDaniel Walton2017-09-201-0/+12
| | | | | | | | | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> This fixes the following cel-redxp-10# show debugging Debugging Information for zebra: Zebra debugging status: Debugging Information for bgpd: BGP debugging status: Debugging Information for watchfrr: % Command incomplete. % Command incomplete. cel-redxp-10#
* build: non-recursive watchfrr & toolsDavid Lamparter2017-09-074-12/+28
| | | | | | (also forgot to remove AC_SUBST(ISISD) earlier) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge pull request #892 from opensourcerouting/watchfrr-simplifyDonald Sharp2017-08-092-249/+83
|\ | | | | simplify watchfrr, add --terminal, improve startup logging
| * watchfrr: print specific error for removed optionsDavid Lamparter2017-08-091-1/+11
| | | | | | | | | | | | ... and document them in the man page. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * watchfrr: remove STATEDIR preprocessor defineDavid Lamparter2017-08-092-16/+8
| | | | | | | | | | | | use frr_vtydir from libfrr instead. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * doc: update watchfrr manpageDavid Lamparter2017-08-021-2/+1
| | | | | | | | | | | | | | Remove -R, -a, -A, -e and -z options. Also remove blocker in the code that refuses to start if --dry is given together with -k / -s / -r. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * watchfrr: remove -z optionDavid Lamparter2017-08-021-16/+6
| | | | | | | | | | | | Why would we not want to restart a daemon that's hanging? Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * watchfrr: remove -e optionDavid Lamparter2017-08-021-12/+2
| | | | | | | | | | | | Why would we not want to PING? Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * watchfrr: remove abundance of modesDavid Lamparter2017-08-021-210/+63
| | | | | | | | | | | | | | This leaves what were previously modes 0 (monitor-only) and 3 (restart daemons individually, but restart everything if zebra is restarted). Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | watchfrr: hide systemd message if not systemd availableJorge Boncompte2017-08-041-0/+2
|/ | | | Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-173-254/+266
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge remote-tracking branch 'frr/master' into newline-reduxDavid Lamparter2017-07-141-1/+1
|\ | | | | | | | | | | Lots of conflicts from CMD_WARNING_CONFIG_FAILED... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * watchfrr: fix error messageJafar Al-Gharaibeh2017-07-121-1/+1
| | | | | | | | Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
* | *: ditch vty_outln(), part 1 of 2David Lamparter2017-07-131-2/+2
|/ | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: use vty_outlnQuentin Young2017-06-291-4/+3
| | | | | | Saves 400 lines Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Merge remote-tracking branch 'origin/stable/2.0'Donald Sharp2017-06-051-2/+0
|\
| * watchfrr: Remove the HAVE_CUMULUS around the watchfrr.started file. It's ↵Martin Winter2017-04-151-2/+0
| | | | | | | | | | | | always useful Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
| * Lowercase frr.confMartín Beauchamp2017-03-091-1/+1
| |
* | *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-153-51/+51
| | | | | | | | | | | | | | | | | | | | | | The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: update thread_add_* callsQuentin Young2017-05-091-31/+43
| | | | | | | | | | | | | | | | | | | | | | | | Pass pointer to pointer instead of assigning by return value. See previous commit message. To ensure that the behavior stays functionally correct, any assignments with the result of a thread_add* function have been transformed to set the pointer to null before passing it. These can be removed wherever the pointer is known to already be null. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | *: remove THREAD_ON macros, add nullity checkQuentin Young2017-05-091-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The way thread.c is written, a caller who wishes to be able to cancel a thread or avoid scheduling it twice must keep a reference to the thread. Typically this is done with a long lived pointer whose value is checked for null in order to know if the thread is currently scheduled. The check-and-schedule idiom is so common that several wrapper macros in thread.h existed solely to provide it. This patch removes those macros and adds a new parameter to all thread_add_* functions which is a pointer to the struct thread * to store the result of a scheduling call. If the value passed is non-null, the thread will only be scheduled if the value is null. This helps with consistency. A Coccinelle spatch has been used to transform code of the form: if (t == NULL) t = thread_add_* (...) to the form thread_add_* (..., &t) The THREAD_ON macros have also been transformed to the underlying thread.c calls. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | watchfrr: make min/max restart interval longoptsDavid Lamparter2017-03-081-7/+10
| | | | | | | | | | | | | | -m/-M seem to be seldomly used... ... and I kindof need/want -M for module loading. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | lib: remove remaining struct zlog * argsDavid Lamparter2017-03-081-3/+3
| | | | | | | | | | | | These don't serve any purpose either. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: add frr_config_fork()David Lamparter2017-03-081-7/+4
| | | | | | | | | | | | | | | | | | 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>
* | *: centralize more into frr_init()David Lamparter2017-03-071-4/+1
| | | | | | | | | | | | Move CLI/VTY/Memory accounting init into frr_* Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: add frr_init() infrastructureDavid Lamparter2017-03-071-79/+71
| | | | | | | | | | | | | | | | | | Start centralising startup & option parsing into the library. FRR_DAEMON_INFO is a bit weird, but it will become useful later (e.g. for killing the ZLOG_* enum, and having the daemon name available) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | Lowercase frr.confMartín Beauchamp2017-02-271-1/+1
| |
* | Merge remote-tracking branch 'origin/stable/2.0'Donald Sharp2017-02-072-2/+2
|\|
| * *: Convert libzebra -> libfrrDonald Sharp2017-02-032-2/+2
| | | | | | | | | | | | | | The library libzebra that is installed with FRR will conflict with Quagga. So let's rename it to libfrr. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | watchfrr: indent to Linux CodingStyleDavid Lamparter2017-01-133-1129/+1079
|/ | | | | | | | | | | | | before this patch, watchfrr was using an inconsistent style that matched neither GNU nor Linux kernel nor BSD style. Reindent to Linux kernel style, which should be pretty close to pimd & ldpd. indent (2.2.11) options used: -nbad -bap -nbc -bbo -hnl -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0 -d0 -di1 -nfc1 -i8 -ip0 -l80 -lp -npcs -nprs -npsl -sai -saf -saw -ncs -nsc -sob -nfca -cp33 -ss -ts8 -il1 Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* watchfrr: Rename watchquagga -> watchfrrDonald Sharp2017-01-045-0/+1631
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>