]> git.proxmox.com Git - mirror_frr.git/blobdiff - tools/frr.in
mgmtd: Bringup MGMTD daemon and datastore module support
[mirror_frr.git] / tools / frr.in
index 27b2c0ab84d8a83b47fe97969ec17226024ba802..c9d48d0279fdab6dc35857e22061372e5bb2f58d 100755 (executable)
@@ -27,7 +27,7 @@ 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.
 # Keep zebra first and do not list watchfrr!
-DAEMONS="zebra bgpd ripd ripngd ospfd ospf6d isisd babeld pimd pim6d ldpd nhrpd eigrpd sharpd pbrd staticd bfdd fabricd vrrpd pathd"
+DAEMONS="mgmtd zebra bgpd ripd ripngd ospfd ospf6d isisd babeld pimd pim6d ldpd nhrpd eigrpd sharpd pbrd staticd bfdd fabricd vrrpd pathd"
 MAX_INSTANCES=5
 RELOAD_SCRIPT="$D_PATH/frr-reload.py"
 
@@ -53,13 +53,6 @@ vtyfile()
        echo "$V_PATH/$1.vty"
 }
 
-chownfrr()
-{
-       test -n "$FRR_USER" && chown "$FRR_USER" "$1"
-       test -n "$FRR_GROUP" && chgrp "$FRR_GROUP" "$1"
-       test -n "$FRR_CONFIG_MODE" && chmod "$FRR_CONFIG_MODE" "$1"
-}
-
 # Check if daemon is started by using the pidfile.
 started()
 {
@@ -103,12 +96,10 @@ check_daemon()
                # check for config file
                if [ -n "$2" ]; then
                        if [ ! -r "$C_PATH/$1-$2.conf" ]; then
-                               touch "$C_PATH/$1-$2.conf"
-                               chownfrr "$C_PATH/$1-$2.conf"
+                               install -g "$FRR_GROUP" -o "$FRR_USER" -m "$FRR_CONFIG_MODE" /dev/null "$C_PATH/$1-$2.conf"
                        fi
                elif [ ! -r "$C_PATH/$1.conf" ]; then
-                       touch "$C_PATH/$1.conf"
-                       chownfrr "$C_PATH/$1.conf"
+                       install -g "$FRR_GROUP" -o "$FRR_USER" -m "$FRR_CONFIG_MODE" /dev/null "$C_PATH/$1.conf"
                fi
        fi
        return 0
@@ -533,9 +524,8 @@ convert_daemon_prios
 
 if [ ! -d $V_PATH ]; then
        echo "Creating $V_PATH"
-       mkdir -p $V_PATH
-       chownfrr $V_PATH
-       chmod 755 /$V_PATH
+       install -g "$FRR_GROUP" -o "$FRR_USER" -m "$FRR_CONFIG_MODE" -d "$V_PATH"
+       chmod gu+x "${V_PATH}"
 fi
 
 if [ -n "$3" ] && [ "$3" != "all" ]; then
@@ -592,7 +582,7 @@ case "$1" in
                NEW_CONFIG_FILE="${2:-$C_PATH/frr.conf}"
                [ ! -r $NEW_CONFIG_FILE ] && echo "Unable to read new configuration file $NEW_CONFIG_FILE" && exit 1
                echo "Applying only incremental changes to running configuration from frr.conf"
-               "$RELOAD_SCRIPT" --reload $C_PATH/frr.conf
+               "$RELOAD_SCRIPT" --reload --bindir "$D_PATH" --confdir "$C_PATH" --rundir "$V_PATH" "$C_PATH/frr.conf"
                exit $?
                ;;