public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-misc/frr/files/
@ 2021-11-01 17:22 Sergey Popov
  0 siblings, 0 replies; 2+ messages in thread
From: Sergey Popov @ 2021-11-01 17:22 UTC (permalink / raw
  To: gentoo-commits

commit:     a18bd023e25cf04c27cfda5f850881eaf2756115
Author:     Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
AuthorDate: Mon Nov  1 17:22:03 2021 +0000
Commit:     Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
CommitDate: Mon Nov  1 17:22:03 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a18bd023

net-misc/frr: fix multi-instance protocols configuration handling

Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Sergey Popov <pinkbyte <AT> gentoo.org>

 net-misc/frr/files/frr-openrc-v1 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net-misc/frr/files/frr-openrc-v1 b/net-misc/frr/files/frr-openrc-v1
index 9e2f1ab914f..3f9da62e2a1 100644
--- a/net-misc/frr/files/frr-openrc-v1
+++ b/net-misc/frr/files/frr-openrc-v1
@@ -92,6 +92,7 @@ _load_daemon_list() {
         for instance in $(echo $cdaemon_instances | tr ',' ' '); do
           watchfrr_daemons="$watchfrr_daemons $daemon-$instance"
         done
+	continue
       fi
 
       # Single instance daemon handling.


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-misc/frr/files/
@ 2023-10-15 22:04 Conrad Kostecki
  0 siblings, 0 replies; 2+ messages in thread
From: Conrad Kostecki @ 2023-10-15 22:04 UTC (permalink / raw
  To: gentoo-commits

commit:     e8f592b09f1fe55eb9caf1bddd0a451a6adb3858
Author:     Michael Mair-Keimberger <mmk <AT> levelnine <DOT> at>
AuthorDate: Sun Oct 15 16:19:36 2023 +0000
Commit:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Sun Oct 15 22:01:38 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e8f592b0

net-misc/frr: remove unused file

Signed-off-by: Michael Mair-Keimberger <mmk <AT> levelnine.at>
Closes: https://github.com/gentoo/gentoo/pull/33351
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>

 net-misc/frr/files/frr-openrc-v1 | 301 ---------------------------------------
 1 file changed, 301 deletions(-)

diff --git a/net-misc/frr/files/frr-openrc-v1 b/net-misc/frr/files/frr-openrc-v1
deleted file mode 100644
index 3f9da62e2a18..000000000000
--- a/net-misc/frr/files/frr-openrc-v1
+++ /dev/null
@@ -1,301 +0,0 @@
-#!/sbin/openrc-run
-#
-# FRR OpenRC init script.
-#
-# Copyright (C) 2020 Rafael F. Zalamena
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; only version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-description="FRR initialization script."
-
-# FRR variables.
-frr_dir="/usr/lib/frr"
-frr_state_dir="/run/frr"
-config_file="/etc/frr/frr.conf"
-daemon_file="/etc/frr/daemons"
-daemon_db="/run/frrdb"
-vty_config_file="/etc/frr/vtysh.conf"
-frr_reload="$frr_dir/frr-reload.py"
-frr_reload_log="$frr_state_dir/reload.log"
-
-# Don't change profile here, use $daemon_file. This is the default.
-frr_profile="traditional"
-
-# watchfrr variables.
-watchfrr_daemons=''
-watchfrr_pidfile="$frr_state_dir/watchfrr.pid"
-
-#
-# Helpers.
-#
-_check_daemon_binary() {
-  local daemon=$1
-
-  [ -x "$frr_dir/$daemon" ] && return 0
-
-  eerror "No binary found for $daemon in $frr_dir"
-  return 1
-}
-
-_load_daemon_list() {
-  # Load FRR daemons configuration file.
-  while read line <&3 ; do
-    case $line in
-      ""|"#"*)
-        # Skip empty/commented lines.
-        continue
-        ;;
-
-      *d=*|*_instances=*|*_options=*|*_wrap=*)
-        # Load daemon options.
-        eval "$line"
-        ;;
-
-      MAX_FDS=*|frr_profile=*|vtysh_enable=*)
-        # Load misc configuration.
-        eval "$line"
-        ;;
-    esac
-  done 3< $daemon_file
-
-  # `zebra` and `staticd` are mandatory.
-  _check_daemon_binary 'zebra' || return 1
-  _check_daemon_binary 'staticd' || return 1
-  watchfrr_daemons='zebra staticd'
-
-  # Create the watchfrr command line.
-  for daemon in \
-    babeld bfdd bgpd eigrpd fabricd isisd ldpd nhrpd ospfd ospf6d pbrd \
-    pimd ripd ripngd sharpd vrrpd \
-  ; do
-    # Trick to read variable name with variable.
-    cdaemon=$(eval echo \$$daemon)
-    cdaemon_instances=$(eval echo \$${daemon}_instances)
-
-    # Add daemon to command line if specified.
-    if [ ! -z $cdaemon ] && [ $cdaemon = 'yes' ]; then
-      _check_daemon_binary $daemon || return 1
-
-      # Multi instance daemon handling.
-      if [ ! -z $cdaemon_instances ]; then
-        for instance in $(echo $cdaemon_instances | tr ',' ' '); do
-          watchfrr_daemons="$watchfrr_daemons $daemon-$instance"
-        done
-	continue
-      fi
-
-      # Single instance daemon handling.
-      watchfrr_daemons="$watchfrr_daemons $daemon"
-      continue
-    fi
-  done
-}
-
-_frr_start() {
-  # Apply MAX_FDS configuration if set.
-  if [ ! -z $MAX_FDS ]; then
-    veinfo "  Setting maximum file descriptors to ${MAX_FDS}"
-    ulimit -n $MAX_FDS >/dev/null 2>/dev/null
-  fi
-
-  # Save started daemons to state database.
-  rm -f -- $daemon_db
-  for daemon in $watchfrr_daemons; do
-    echo $daemon >> $daemon_db
-    veinfo "  Starting $daemon..."
-  done
-
-  veinfo "  Starting watchfrr..."
-
-  # Start watchfrr which will start all configured daemons.
-  eval $all_wrap $frr_dir/watchfrr -d -F $frr_profile $watchfrr_daemons
-
-  veinfo "  Loading configuration..."
-
-  # After starting the daemons, lets load the configuration.
-  if [ $vtysh_enable = 'yes' ]; then
-    vtysh -b -n
-  else
-    veinfo "  Configuration loading disabled (vtysh_enable=$vtysh_enable)"
-  fi
-}
-
-_get_pid() {
-  local daemon=$1
-  local pid_file="$frr_state_dir/$daemon.pid"
-
-  # Test for file existence.
-  if [ ! -r "$pid_file" ]; then
-    eerror "Failed to find or read $daemon pid file"
-    return 1
-  fi
-
-  # Get PID if any.
-  pid=$(cat $pid_file)
-  if [ -z $pid ]; then
-    eerror "$daemon PID file empty"
-    return 1
-  fi
-
-  return 0
-}
-
-_stop_daemon() {
-  local daemon=$1
-  local pid_file="$frr_state_dir/$daemon.pid"
-
-  # Get daemon pid.
-  _get_pid $daemon
-
-  # Ask daemon to quit.
-  kill -2 "$pid"
-
-  # Test if daemon is still running.
-  attempts=1200
-  while kill -0 "$pid" 2>/dev/null; do
-    sleep 0.5
-    [ $((attempts - 1)) -gt 0 ] || break
-  done
-
-  # Tell user about our situation.
-  if kill -0 "$pid" 2>/dev/null ; then
-    eerror "Failed to stop $daemon (PID=${pid})"
-    return 1
-  else
-    rm -f -- $pid_file
-  fi
-}
-
-_frr_stop() {
-  local failures=0
-
-  # Stop watchfrr first so it doesn't restart anyone.
-  veinfo "  Stopping watchfrr..."
-  _stop_daemon watchfrr || failures=1
-
-  # Read started daemon database.
-  while read line <&3 ; do
-    case $line in
-      ""|"#"*)
-        # Skip empty/commented lines.
-        continue
-        ;;
-
-      *)
-        # Get daemon name.
-        veinfo "  Stopping $line..."
-        _stop_daemon $line || failures=1
-        ;;
-    esac
-  done 3< $daemon_db
-
-  # Remove daemon database file.
-  rm -f -- $daemon_db
-
-  return $failures
-}
-
-_check_watchfrr() {
-  _get_pid watchfrr || return 1
-  return 0
-}
-
-#
-# Main.
-#
-depend() {
-  # We need root to write logs.
-  need localmount
-  # Optionally wait for network to start.
-  use net
-  # Expect /run to be ready.
-  after bootmisc
-}
-
-start_pre() {
-  # Check configuration file readability.
-  checkpath -f -m 0640 -o frr:frr $vty_config_file
-  checkpath -f -m 0640 -o frr:frr $daemon_file
-  checkpath -f -m 0640 -o frr:frr $config_file
-
-  # Check run state directory.
-  checkpath -d -o frr $frr_state_dir
-
-  # Load daemon list and peform checks.
-  _load_daemon_list
-}
-
-start() {
-  # Load daemon list.
-  _load_daemon_list
-
-  # Handle restarts.
-  if [ "$RC_CMD" = 'restart' ]; then
-    ebegin 'Reloading FRR configuration'
-  else
-    ebegin 'Starting FRR'
-  fi
-
-  # Start FRR.
-  _frr_start
-
-  # New daemons and watchfrr started, apply new configuration.
-  if [ "$RC_CMD" = 'restart' ]; then
-    "$frr_reload" --reload "$config_file" 2>/run/frr/reload.log
-    [ $? -ne 0 ] && ewarn "  Failed to reload (check $frr_reload_log)"
-    # NOTE: we can't return bad status otherwise OpenRC will think we
-    # failed to start, lets print a helpful message instead.
-  fi
-
-  eend 0
-}
-
-stop() {
-  local failures=0
-
-  # Handle restarts.
-  if [ "$RC_CMD" = 'restart' ]; then
-    # Load daemon list.
-    _load_daemon_list
-
-    # We must restart 'watchfrr' in order to start new daemons.
-    veinfo "  Stopping watchfrr..."
-    _stop_daemon watchfrr
-
-    # Stop daemons that are no longer in configuration file.
-    for daemon in $(ls -1 /run/frr/*.pid | cut -d '.' -f 1); do
-      # Filter daemon name.
-      daemon=$(basename "$daemon")
-
-      # Skip watchfrr.
-      [ "$daemon" = 'watchfrr' ] && continue
-
-      echo "$watchfrr_daemons" | grep "$daemon" >/dev/null
-      if [ $? -ne 0 ]; then
-        veinfo "  Stopping $daemon..."
-        _stop_daemon $daemon
-      fi
-    done
-
-    return 0
-  fi
-
-  ebegin 'Stopping FRR'
-  _frr_stop || failures=1
-  eend $failures 'some daemons failed to stop'
-}
-
-status() {
-  _check_watchfrr || return 1
-}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-15 22:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-01 17:22 [gentoo-commits] repo/gentoo:master commit in: net-misc/frr/files/ Sergey Popov
  -- strict thread matches above, loose matches on Subject: below --
2023-10-15 22:04 Conrad Kostecki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox