summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranlan_cs <anlan_cs@tom.com>2021-12-30 00:17:05 -0500
committeranlan_cs <anlan_cs@tom.com>2022-01-06 07:42:36 -0500
commitfc539216ceb43f114e39cb25b34e312c28ca08ae (patch)
treed692565b361097b753b024fb86eec3c06adff384
parent5086cc1c6639180fbc34da7e534a09dff6d8669a (diff)
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=<digit> Signed-off-by: anlan_cs <anlan_cs@tom.com>
-rw-r--r--configure.ac16
-rw-r--r--doc/user/installation.rst7
-rw-r--r--tools/frr.service.in2
-rw-r--r--tools/frr@.service.in2
4 files changed, 25 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index c7a5f12863..0d598954cc 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 fdf5bab9c9..539076669a 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 f67bc41b09..df1e4f3b08 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 7b94a11f5b..1cbef1b18c 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