summaryrefslogtreecommitdiffstats
path: root/tools/frr.in
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2018-10-26 19:33:20 +0200
committerDavid Lamparter <equinox@diac24.net>2019-12-06 15:13:32 +0100
commit684959068c7a26d74c628182957447035e2179c2 (patch)
treec91097c18d41262acdf7acaea104d596043784f1 /tools/frr.in
parentlib/defaults: add bool variable support (diff)
downloadfrr-684959068c7a26d74c628182957447035e2179c2.tar.xz
frr-684959068c7a26d74c628182957447035e2179c2.zip
build: apply DFLT_NAME/profiles in init script
Hopefully at some point we can get rid of the --enable-datacenter switch and just have the init script do magic. Should already work for Cumulus as it is. NB: the profile name can't be baked into the package. The whole point is to make the package profile-agnostic; in theory at some point the exact same package files should work on both, say, a Cumulus switch and a Linux software BGP DFZ router. Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'tools/frr.in')
-rwxr-xr-xtools/frr.in21
1 files changed, 17 insertions, 4 deletions
diff --git a/tools/frr.in b/tools/frr.in
index a21b06752..d9816c256 100755
--- a/tools/frr.in
+++ b/tools/frr.in
@@ -21,6 +21,7 @@ VTYSH="@vtysh_bin@" # /usr/bin/vtysh
FRR_USER="@enable_user@" # frr
FRR_GROUP="@enable_group@" # frr
FRR_VTY_GROUP="@enable_vty_group@" # frrvty
+FRR_DEFAULT_PROFILE="@DFLT_NAME@" # traditional / datacenter
# Local Daemon selection may be done by using /etc/frr/daemons.
# See /usr/share/doc/frr/README.Debian.gz for further information.
@@ -151,7 +152,7 @@ start()
--pidfile=`pidfile $dmn-$inst` \
--exec "$D_PATH/$dmn" \
-- \
- `eval echo "$""$dmn""_options"` -n "$inst"
+ `eval echo "$""$dmn""_options"` $frr_global_options -n "$inst"
else
if ! check_daemon $dmn; then
echo -n " (binary does not exist)"
@@ -164,14 +165,14 @@ start()
--pidfile=`pidfile $dmn` \
--exec "$valgrind" \
-- --trace-children=no --leak-check=full --log-file=/var/log/frr/$dmn-valgrind.log $D_PATH/$dmn \
- `eval echo "$""$dmn""_options"`
+ `eval echo "$""$dmn""_options"` $frr_global_options
else
${SSD} \
--start \
--pidfile=`pidfile $dmn` \
--exec "$D_PATH/$dmn" \
-- \
- `eval echo "$""$dmn""_options"`
+ `eval echo "$""$dmn""_options"` $frr_global_options
fi
fi
@@ -188,7 +189,7 @@ start()
--pidfile=`pidfile staticd` \
--exec "$D_PATH/staticd" \
-- \
- `eval echo "$"staticd"_options"`
+ `eval echo "$"staticd"_options"` $frr_global_options
fi
}
@@ -511,6 +512,18 @@ fi
# Read configuration variable file if it is present
[ -r /etc/default/frr ] && . /etc/default/frr
+if test -z "$frr_profile"; then
+ # try to autodetect config profile
+ if test -d /etc/cumulus; then
+ frr_profile=datacenter
+ # elif test ...; then
+ # -- add your distro/system here
+ elif test -n "$FRR_DEFAULT_PROFILE"; then
+ frr_profile="$FRR_DEFAULT_PROFILE"
+ fi
+fi
+test -n "$frr_profile" && frr_global_options="$frr_global_options -F $frr_profile"
+
MAX_INSTANCES=${MAX_INSTANCES:=5}
# Set priority of un-startable daemons to 'no' and substitute 'yes' to '0'