]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #3536 from opensourcerouting/6.0-kill-backports
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 27 Dec 2018 19:02:33 +0000 (14:02 -0500)
committerGitHub <noreply@github.com>
Thu, 27 Dec 2018 19:02:33 +0000 (14:02 -0500)
6.0 fixes from package testing

debian/control
debian/frr.postinst
doc/developer/packaging-debian.rst
tools/frrcommon.sh.in
watchfrr/watchfrr.c

index 006554c5fda326a7653ca63737566e08fdce7231..022d296046c68f5a67faae0a54fb42e8054ea96f 100644 (file)
@@ -27,6 +27,7 @@ Build-Depends:
  libsystemd-dev <!pkg.frr.nosystemd>,
  pkg-config,
  python3,
+ python3-dev,
  python3-sphinx,
  python3-pytest <!nocheck>,
  texinfo (>= 4.7)
index a6dff333aae283f197cbad31e0d262d361edb65f..dac2fa0f05ac9d65ab1723f6299b759203ce25d1 100644 (file)
@@ -12,6 +12,7 @@ adduser \
        --ingroup frr \
        --home /nonexistent \
        --gecos "Frr routing suite" \
+       --no-create-home \
        frr
 usermod -a -G frrvty frr
 
index 55e35c332f0fd67a7fe23d3c48770e2daf326dbd..a5834a357ff23a1ae18f003c9b87a8698bf41470 100644 (file)
@@ -10,17 +10,7 @@ buster.)
 
       sudo apt install fakeroot debhelper devscripts
 
-2. Install build dependencies using the  `mk-build-deps` tool from the
-   `devscripts` package:
-
-   .. code-block:: shell
-
-      sudo mk-build-deps --install debianpkg/control
-
-   Alternatively, you can manually install build dependencies for your
-   platform as outlined in :ref:`building`.
-
-3. Checkout FRR under an **unprivileged** user account:
+2. Checkout FRR under an **unprivileged** user account:
 
    .. code-block:: shell
 
@@ -33,6 +23,16 @@ buster.)
 
       git checkout <branch>
 
+3. Install build dependencies using the  `mk-build-deps` tool from the
+   `devscripts` package:
+
+   .. code-block:: shell
+
+      sudo mk-build-deps --install debian/control
+
+   Alternatively, you can manually install build dependencies for your
+   platform as outlined in :ref:`building`.
+
 4. Run ``tools/tarsource.sh -V``:
 
    .. code-block:: shell
index fa2fdc94b2af6973083060e0819eda70e3bd04d5..588aa6d103e10a086c3e1dcedeb63114fb53adf2 100644 (file)
@@ -85,6 +85,9 @@ daemon_list() {
                eval inst=\$${daemon}_instances
                [ "$daemon" = zebra -o "$daemon" = staticd ] && cfg=yes
                if [ -n "$cfg" -a "$cfg" != "no" -a "$cfg" != "0" ]; then
+                       if ! daemon_prep "$daemon" "$inst"; then
+                               continue
+                       fi
                        debug "$daemon enabled"
                        enabled="$enabled $daemon"
                        if [ -n "$inst" ]; then
index 5230ec383f2bd9fad47473ed262666d60058843e..7e75bed2d6edd4592b974f05f551aea6ddce983c 100644 (file)
@@ -83,6 +83,7 @@ static const char *phase_str[] = {
 };
 
 #define PHASE_TIMEOUT (3*gs.restart_timeout)
+#define STARTUP_TIMEOUT        55 * 1000
 
 struct restart_info {
        const char *name;
@@ -97,6 +98,7 @@ struct restart_info {
 static struct global_state {
        restart_phase_t phase;
        struct thread *t_phase_hanging;
+       struct thread *t_startup_timeout;
        const char *vtydir;
        long period;
        long timeout;
@@ -630,23 +632,38 @@ static int handle_read(struct thread *t_read)
  * Wait till we notice that all daemons are ready before
  * we send we are ready to systemd
  */
-static void daemon_send_ready(void)
+static void daemon_send_ready(int exitcode)
 {
+       FILE *fp;
        static int sent = 0;
-       if (!sent && gs.numdown == 0) {
-               FILE *fp;
 
+       if (sent)
+               return;
+
+       if (exitcode == 0)
                zlog_notice("all daemons up, doing startup-complete notify");
-               frr_detach();
+       else if (gs.numdown < gs.numdaemons)
+               flog_err(WATCHFRR_ERR_CONNECTION,
+                        "startup did not complete within timeout"
+                        " (%d/%d daemons running)",
+                        gs.numdaemons - gs.numdown, gs.numdaemons);
+       else {
+               flog_err(WATCHFRR_ERR_CONNECTION,
+                        "all configured daemons failed to start"
+                        " -- exiting watchfrr");
+               exit(exitcode);
+
+       }
 
-               fp = fopen(DAEMON_VTY_DIR "/watchfrr.started", "w");
-               if (fp)
-                       fclose(fp);
+       frr_detach();
+
+       fp = fopen(DAEMON_VTY_DIR "/watchfrr.started", "w");
+       if (fp)
+               fclose(fp);
 #if defined HAVE_SYSTEMD
-               systemd_send_started(master, 0);
+       systemd_send_started(master, 0);
 #endif
-               sent = 1;
-       }
+       sent = 1;
 }
 
 static void daemon_up(struct daemon *dmn, const char *why)
@@ -655,7 +672,8 @@ static void daemon_up(struct daemon *dmn, const char *why)
        gs.numdown--;
        dmn->connect_tries = 0;
        zlog_notice("%s state -> up : %s", dmn->name, why);
-       daemon_send_ready();
+       if (gs.numdown == 0)
+               daemon_send_ready(0);
        SET_WAKEUP_ECHO(dmn);
        phase_check();
 }
@@ -1030,6 +1048,12 @@ static char *translate_blanks(const char *cmd, const char *blankstr)
        return res;
 }
 
+static int startup_timeout(struct thread *t_wakeup)
+{
+       daemon_send_ready(1);
+       return 0;
+}
+
 static void watchfrr_init(int argc, char **argv)
 {
        const char *special = "zebra";
@@ -1037,6 +1061,9 @@ static void watchfrr_init(int argc, char **argv)
        struct daemon *dmn, **add = &gs.daemons;
        char alldaemons[512] = "", *p = alldaemons;
 
+       thread_add_timer_msec(master, startup_timeout, NULL, STARTUP_TIMEOUT,
+                             &gs.t_startup_timeout);
+
        for (i = optind; i < argc; i++) {
                dmn = XCALLOC(MTYPE_WATCHFRR_DAEMON, sizeof(*dmn));