summaryrefslogtreecommitdiffstats
path: root/watchfrr (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: fix some dumb printf format warningsDavid Lamparter2019-06-111-4/+5
| | | | | | | Some types like `time_t` vary across platforms and always need to be cast when printed. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: Convert over to all -N namespace to change DAEMON_VTY_DIRDonald Sharp2019-06-051-1/+1
| | | | | | | | When the user specifies -N namespace allow it to influence the frr_vtydir(DAEMON_VTY_DIR) to have namespace in it's path like so: $frrstate_dir/<namespace> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Convert to using frr_vtydir instead of DAEMON_VTY_DIRDonald Sharp2019-06-041-1/+4
| | | | | | | | In a variety of places we are using DAEMON_VTY_DIR, convert to use frr_vtydir. This will allow us in a future commit to have the -N namespace option be automatically used. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* watchfrr: build in defaults for -r/-s/-kDavid Lamparter2019-02-191-1/+13
| | | | | | | | | There's no good reason to not have these options default to the installation path of tools/watchfrr.sh. Doing so allows us to ditch watchfrr_options from daemons/daemons.conf completely. Fixes: #3652 Signed-off-by: David Lamparter <equinox@diac24.net>
* watchfrr: don't wait forever at startupDavid Lamparter2019-02-191-11/+38
| | | | | | | If we wait forever for all daemons to come up, we can hang the entire boot process, especially on init.d based systems. Signed-off-by: David Lamparter <equinox@diac24.net>
* build: fix a whole bunch of *FLAGSDavid Lamparter2019-01-301-1/+1
| | | | | | | | | - some target_CFLAGS that needed to include AM_CFLAGS didn't do so - libyang/sysrepo/sqlite3/confd CFLAGS + LIBS weren't used at all - consistently use $(FOO_CFLAGS) instead of @FOO_CFLAGS@ - 2 dependencies were missing for clippy Signed-off-by: David Lamparter <equinox@diac24.net>
* watchfrr: add status commandDavid Lamparter2018-12-063-1/+41
| | | | | | Just to see WTF is going on inside watchfrr... Signed-off-by: David Lamparter <equinox@diac24.net>
* watchfrr: immediately try connecting after startDavid Lamparter2018-12-061-1/+24
| | | | | | | | | | | | When we make a call to (re)start some daemon(s), we can immediately try connecting to its VTY socket after the script completes. If the daemon started correctly, this will always succeed since the start script only returns after daemon startup is complete. Among other things, this reduces the delay to "startup complete" notification at initial watchfrr start. Signed-off-by: David Lamparter <equinox@diac24.net>
* watchfrr: don't wait around pointlessly at startupDavid Lamparter2018-12-061-4/+21
| | | | | | | We were waiting for timers to expire even when we already know the status of all daemons. This delays startup for no good reason. Signed-off-by: David Lamparter <equinox@diac24.net>
* watchfrr, lib: cleanup & delay detachingDavid Lamparter2018-10-022-100/+69
| | | | | | | | | | | This cleans up watchfrr to be more "normal" like the other daemons in terms of what it does in main(), i.e. using the full frr_*() call set. Also, this changes the startup behaviour on watchfrr to stay attached on the daemon's parent process until startup is really complete. This should allow removing the "watchfrr.started" hack at some point. Signed-off-by: David Lamparter <equinox@diac24.net>
* watchfrr: Modify some stderr messages to zlog_warnDonald Sharp2018-09-253-3/+11
| | | | | | | | | | | | | The stderr output is not being displayed as part of watchfrr invocation in system startup. Specifically if the user has not properly sent 1 or more daemons to monitor. If the end-user is using tools/frr this stderr is dropped( and systemd appears to drop stderr too? ) Modify the two stderr calls in this situation and use the zlog system. Now I can clearly see an error message that tells me what has gone wrong. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> [DL: fixed typo]
* *: style for EC replacementsQuentin Young2018-09-131-12/+12
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: LIB_[ERR|WARN] -> EC_LIBQuentin Young2018-09-131-9/+9
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* watchfrr: WATCHFRR_[ERR|WARN] -> EC_WATCHFRRQuentin Young2018-09-133-7/+7
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* build: fix not building docs w/o sphinxDavid Lamparter2018-09-091-1/+1
| | | | | | Can't build manpages without sphinx-build, oops... Signed-off-by: David Lamparter <equinox@diac24.net>
* *: cleanup .gitignore filesDavid Lamparter2018-09-081-15/+0
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* build: move vtysh & manpage listings to subdir.amDavid Lamparter2018-09-081-0/+2
| | | | | | | Since we're now building through one large Makefile, we can easily put things with their daemons and crossreference nicely. Signed-off-by: David Lamparter <equinox@diac24.net>
* 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>