openwrt / openwrt/packages

frr: Service frr restart stop all deamons and service frr reload didn't stop

Open
#23,005 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Makefile
Stars
4.6k
Forks
4k
Avg merge
3d 12h
Merged PRs (30d)
134

Description

Maintainer: @lucize
Environment: OpenWRT 23.05.0 x86-64 generic ran inside QEMU in GNS3, FRRouting 9.0.0

Description

  1. In code frr service restart, all daemons stoped, becouse variable $daemons is always empty, variable is defined below.
    in_list $i $daemons || daemon_stop $i
    https://github.com/openwrt/packages/blob/master/net/frr/files/frr
  2. In code frr service reload, restart only watchfrr, if enable daemons in /etc/frr/daemons watchfrr run this deamons, if disabled daemons in /etc/frr/daemons didn't stop daemons. Fix (just add code from restart to reload, for stop diabled daemons):
reload() {
	RELOAD_SCRIPT="/usr/sbin/frr-reload"
	if [ ! -x "$RELOAD_SCRIPT" ]; then
		log_failure_msg "The frr-pythontools package is required for reload functionality."
		exit 1
	fi

	# restart watchfrr to pick up added daemons.
	# NB: This will NOT cause the other daemons to be restarted.
	daemon_list daemons
	all_daemon_list all_daemons
	watchfrr_pid=`pidof watchfrr`
	for i in `tr '\0' '\n' < /proc/$watchfrr_pid/cmdline | sed -n '1!G;h;$p'`; do
	in_list $i $all_daemons || break
	in_list $i $daemons || daemon_stop $i
	done
	watchfrr_options="$watchfrr_options $daemons"
	daemon_stop watchfrr && \
		daemon_start watchfrr

	NEW_CONFIG_FILE="${2:-$C_PATH/frr.conf}"
	[ ! -r $NEW_CONFIG_FILE ] && log_failure_msg "Unable to read new configuration file $NEW_CONFIG_FILE" && exit 1
	"$RELOAD_SCRIPT" --reload "$NEW_CONFIG_FILE"
	exit $?
}

Sorry if I'm wrong, main problem I don't know how stop daemons without stoped all daemons

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with net/frr/files/frr and compare the restart and reload functions, focusing on how daemons and all_daemons are populated and how daemon_stop is called. Reproduce the behavior in the reported OpenWrt 23.05.0 x86-64 QEMU environment with FRRouting 9.0.0, then verify that reload stops disabled daemons without stopping enabled ones.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.