aboutsummaryrefslogtreecommitdiffstats
path: root/package/network
diff options
context:
space:
mode:
Diffstat (limited to 'package/network')
-rw-r--r--package/network/services/lldpd/files/lldpd.init19
1 files changed, 18 insertions, 1 deletions
diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init
index 3d7d8b93d3..04e5b8ca63 100644
--- a/package/network/services/lldpd/files/lldpd.init
+++ b/package/network/services/lldpd/files/lldpd.init
@@ -4,6 +4,8 @@
START=90
USE_PROCD=1
+LLDPCLI=/usr/sbin/lldpcli
+LLDPSOCKET=/var/run/lldpd.socket
find_release_info()
{
@@ -71,6 +73,21 @@ start_service() {
procd_close_instance
}
+service_running() {
+ pgrep -x /usr/sbin/lldpd &> /dev/null
+}
+
+reload_service() {
+ running || return 1
+ # Custom TLVs are special and should be
+ # reloaded from config during lldpd reload
+ $LLDPCLI -u $LLDPSOCKET unconfigure lldp custom-tlv &> /dev/null
+ $LLDPCLI -u $LLDPSOCKET -c /etc/lldpd.conf -c /etc/lldpd.d &> /dev/null
+ # Broadcast update over the wire
+ $LLDPCLI -u $LLDPSOCKET update &> /dev/null
+ return 0
+}
+
stop_service() {
- rm -f /var/run/lldpd.socket /var/run/lldpd.pid
+ rm -rf /var/run/lldp $LLDPSOCKET
}