diff mbox series

[3/7] lldpd: fix restart

Message ID 20240402130221.58706-3-newtwen+github@gmail.com
State New
Headers show
Series [1/7] lldpd: fixed interface(s) parsing | expand

Commit Message

Paul Donald April 2, 2024, 1:02 p.m. UTC
redirection broke in 5364fe0f01ca11b47c55d78f756d3176748dd0c2

redirects to /dev/null shall be handled correctly (i.e. last).

This fixes these errors on `/etc/init.d/lldpd reload`:

2024-03-16T20:39:00 [WARN/lldpctl] unknown command from argument 1: `/dev/null`
2024-03-16T20:39:00 [WARN/lldpctl] unknown command from argument 1: `/dev/null`
2024-03-16T20:39:00 [WARN/lldpctl] unknown command from argument 1: `/dev/null`
2024-03-16T20:39:00 [WARN/lldpctl] unknown command from argument 1: `/dev/null`

Tested on: 22.03.6

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
---
 package/network/services/lldpd/files/lldpd.init | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Jo-Philipp Wich April 2, 2024, 11:13 p.m. UTC | #1
Hi,

> redirection broke in 5364fe0f01ca11b47c55d78f756d3176748dd0c2

why did this slip through in the first place? Seems that neither the submitter 
(you) nor the comitter actually runtime tested those changes described as " No 
functionality/behaviour changes; code is synonymous".

~ Jo
diff mbox series

Patch

diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init
index 069c8fee80..0334156fee 100644
--- a/package/network/services/lldpd/files/lldpd.init
+++ b/package/network/services/lldpd/files/lldpd.init
@@ -363,7 +363,7 @@  reload_service() {
 		return 0
 	fi
 
-	$LLDPCLI -u "$LLDPSOCKET" 2>&1 /dev/null <<-EOF
+	$LLDPCLI -u "$LLDPSOCKET" >/dev/null 2>&1 <<-EOF
 		pause
 		unconfigure lldp custom-tlv
 		unconfigure system interface pattern
@@ -373,7 +373,7 @@  reload_service() {
 		unconfigure system platform
 	EOF
 	if [ "$CONFIG_LLDPD_WITH_LLDPMED" = "y" ]; then
-		$LLDPCLI -u "$LLDPSOCKET" 2>&1 /dev/null <<-EOF
+		$LLDPCLI -u "$LLDPSOCKET" >/dev/null 2>&1 <<-EOF
 			unconfigure med fast-start
 		EOF
 
@@ -381,9 +381,9 @@  reload_service() {
 	# Rewrite lldpd.conf
 	# If something changed it should be included by the lldpcli call
 	write_lldpd_conf
-	$LLDPCLI -u "$LLDPSOCKET" -c "$LLDPD_CONF" -c "$LLDPD_CONFS_DIR" 2>&1 /dev/null
+	$LLDPCLI -u "$LLDPSOCKET" -c "$LLDPD_CONF" -c "$LLDPD_CONFS_DIR" >/dev/null 2>&1 
 	# Broadcast update over the wire
-	$LLDPCLI -u "$LLDPSOCKET" 2>&1 /dev/null <<-EOF
+	$LLDPCLI -u "$LLDPSOCKET" >/dev/null 2>&1 <<-EOF
 		resume
 		update
 	EOF
@@ -391,6 +391,6 @@  reload_service() {
 }
 
 stop_service() {
-	rm -rf ${LLDPD_RUN} "$LLDPSOCKET" 2> /dev/null
+	rm -rf ${LLDPD_RUN} "$LLDPSOCKET" >/dev/null 2>&1
 }