From fc539216ceb43f114e39cb25b34e312c28ca08ae Mon Sep 17 00:00:00 2001 From: anlan_cs Date: Thu, 30 Dec 2021 00:17:05 -0500 Subject: [PATCH] build: add "--with-service-timeout" in configure.ac On lower CPU with lots of static routes, it will cost more than 2 minutes. 2 minutes is the default timeout value, we can adjust it by configure: ./configure --with-service-timeout= Signed-off-by: anlan_cs --- configure.ac | 16 ++++++++++++++++ doc/user/installation.rst | 7 +++++++ tools/frr.service.in | 2 +- tools/frr@.service.in | 2 +- 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index c7a5f1286..0d598954c 100644 --- a/configure.ac +++ b/configure.ac @@ -661,6 +661,8 @@ AC_ARG_ENABLE([ospfclient], (this is the default if --disable-ospfapi is set)])) AC_ARG_ENABLE([multipath], AS_HELP_STRING([--enable-multipath=ARG], [enable multipath function, ARG must be digit])) +AC_ARG_WITH([service_timeout], + AS_HELP_STRING([--with-service-timeout=ARG], [set service timeout value (2 minutes by default), ARG must be digit])) AC_ARG_ENABLE([user], AS_HELP_STRING([--enable-user=USER], [user to run FRR suite as (default frr)])) AC_ARG_ENABLE([group], @@ -932,6 +934,20 @@ AC_DEFINE_UNQUOTED([MULTIPATH_NUM], [$MPATH_NUM], [Maximum number of paths for a AC_DEFINE_UNQUOTED([VTYSH_PAGER], ["$VTYSH_PAGER"], [What pager to use]) + +TIMEOUT_MIN=2 +case "${with_service_timeout}" in + [[1-9]|[1-9][0-9]|[1-9][0-9][0-9]]) + TIMEOUT_MIN="${with_service_timeout}" + ;; + 0|"") + ;; + *) + AC_MSG_FAILURE([Please specify digit for timeout ARG]) + ;; +esac +AC_SUBST([TIMEOUT_MIN]) + dnl -------------------- dnl Enable code coverage dnl -------------------- diff --git a/doc/user/installation.rst b/doc/user/installation.rst index fdf5bab9c..539076669 100644 --- a/doc/user/installation.rst +++ b/doc/user/installation.rst @@ -273,6 +273,13 @@ options from the list below. Build with FPM module support. +.. option:: --with-service-timeout=X + + Set timeout value for FRR service. The time of restarting or reloading FRR + service should not exceed this value. This number can be from 0-999. + Additionally if this parameter is not passed or setting X = 0, FRR will take + default value: 2 minutes. + .. option:: --enable-numeric-version Alpine Linux does not allow non-numeric characters in the version string. diff --git a/tools/frr.service.in b/tools/frr.service.in index f67bc41b0..df1e4f3b0 100644 --- a/tools/frr.service.in +++ b/tools/frr.service.in @@ -12,7 +12,7 @@ Type=forking NotifyAccess=all StartLimitInterval=3m StartLimitBurst=3 -TimeoutSec=2m +TimeoutSec=@TIMEOUT_MIN@m WatchdogSec=60s RestartSec=5 Restart=on-abnormal diff --git a/tools/frr@.service.in b/tools/frr@.service.in index 7b94a11f5..1cbef1b18 100644 --- a/tools/frr@.service.in +++ b/tools/frr@.service.in @@ -12,7 +12,7 @@ Type=forking NotifyAccess=all StartLimitInterval=3m StartLimitBurst=3 -TimeoutSec=2m +TimeoutSec=@TIMEOUT_MIN@m WatchdogSec=60s RestartSec=5 Restart=on-abnormal -- 2.39.2