[openwrt/openwrt] lldpd: fix restart

LEDE Commits lede-commits at lists.infradead.org
Tue Sep 17 03:36:46 PDT 2024


robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/ca0c2363c2c158d73e3c4cc8f62270f672601373

commit ca0c2363c2c158d73e3c4cc8f62270f672601373
Author: Paul Donald <newtwen+github at gmail.com>
AuthorDate: Tue Apr 2 13:42:20 2024 +0200

    lldpd: fix restart
    
    Redirection broke in 5364fe0f01ca ("lldpd: shellcheck fixes")
    
    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
    Fixes: 5364fe0f01ca ("lldpd: shellcheck fixes")
    Signed-off-by: Paul Donald <newtwen+github at gmail.com>
    [ improve commit description, add fixes tag ]
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
    (cherry picked from commit 8cf1dce428b11740d8335d167b9c1f297d1752d0)
    Link: https://github.com/openwrt/openwrt/pull/15299
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/network/services/lldpd/files/lldpd.init | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init
index 67ee011ae2..ca09a501f6 100644
--- a/package/network/services/lldpd/files/lldpd.init
+++ b/package/network/services/lldpd/files/lldpd.init
@@ -349,7 +349,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
@@ -359,7 +359,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
 
@@ -367,9 +367,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
@@ -377,6 +377,6 @@ reload_service() {
 }
 
 stop_service() {
-	rm -rf ${LLDPD_RUN} "$LLDPSOCKET" 2> /dev/null
+	rm -rf ${LLDPD_RUN} "$LLDPSOCKET" >/dev/null 2>&1
 }
 




More information about the lede-commits mailing list