Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
84
Issues
84
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
c187ed89
Commit
c187ed89
authored
Jul 17, 2018
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Kconfig: add possibility to disable LLDPD from dot-config
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
a1e5bec2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
8 deletions
+40
-8
Kconfig
Kconfig
+9
-0
lldpd.sh
userspace/rootfs_override/etc/init.d/lldpd.sh
+31
-8
No files found.
Kconfig
View file @
c187ed89
...
@@ -920,6 +920,15 @@ config CUSTOM_BOOT_SCRIPT_SOURCE_REMOTE_URL
...
@@ -920,6 +920,15 @@ config CUSTOM_BOOT_SCRIPT_SOURCE_REMOTE_URL
endmenu
endmenu
menu "LLDP options"
config LLDPD_DISABLE
bool "Disable LLDP daemon"
default n
help
Disable LLDP daemon to prevent sending LLDP frames. It may be useful
for networks not using LLDP or with a low latency requirement.
endmenu
config HTTPD_DISABLE
config HTTPD_DISABLE
bool "Disable web interface"
bool "Disable web interface"
default n
default n
...
...
userspace/rootfs_override/etc/init.d/lldpd.sh
View file @
c187ed89
...
@@ -7,6 +7,7 @@ LLDPD_CONFIG=/etc/lldpd.conf
...
@@ -7,6 +7,7 @@ LLDPD_CONFIG=/etc/lldpd.conf
LLDPD
=
/usr/sbin/lldpd
LLDPD
=
/usr/sbin/lldpd
# -x -- Enable SNMP subagent.
# -x -- Enable SNMP subagent.
LLDPD_OPT
=
-x
LLDPD_OPT
=
-x
MONIT
=
/usr/bin/monit
dotconfig
=
/wr/etc/dot-config
dotconfig
=
/wr/etc/dot-config
...
@@ -29,14 +30,26 @@ start() {
...
@@ -29,14 +30,26 @@ start() {
echo
"configure system hostname '
$(
hostname
)
'"
>
$LLDPD_CONFIG
echo
"configure system hostname '
$(
hostname
)
'"
>
$LLDPD_CONFIG
echo
"configure system description 'WR-SWITCH:
$(
/wr/bin/wrsw_version
)
'"
>>
$LLDPD_CONFIG
echo
"configure system description 'WR-SWITCH:
$(
/wr/bin/wrsw_version
)
'"
>>
$LLDPD_CONFIG
echo
"resume"
>>
$LLDPD_CONFIG
echo
"resume"
>>
$LLDPD_CONFIG
echo
"OK"
echo
-n
"Starting lldpd: "
echo
-n
"Starting lldpd: "
# if [ -f $dotconfig ]; then
# . $dotconfig
if
[
-f
$dotconfig
]
;
then
# else
.
$dotconfig
# echo "$0 unable to source dot-config ($dotconfig)!"
else
# fi
echo
"
$0
unable to source dot-config (
$dotconfig
)!"
#
fi
if
[
"
$CONFIG_LLDPD_DISABLE
"
=
"y"
]
;
then
echo
"lldpd disabled in dot-config!"
if
[
"
$1
"
!=
"force"
]
;
then
# Unmonitor lldpd, ignore all printouts from monit.
# Run in background since monit may wait for a timeout.
$MONIT
unmonitor lldpd &>/dev/null &
exit
0
fi
echo
-n
"Force start of lldpd: "
fi
start-stop-daemon
-S
-q
-p
/var/run/lldpd.pid
--exec
$LLDPD
--
$LLDPD_OPT
start-stop-daemon
-S
-q
-p
/var/run/lldpd.pid
--exec
$LLDPD
--
$LLDPD_OPT
ret
=
$?
ret
=
$?
...
@@ -48,6 +61,15 @@ start() {
...
@@ -48,6 +61,15 @@ start() {
else
else
echo
"Failed"
echo
"Failed"
fi
fi
# check whether the process was monitored
$MONIT
summary 2>&1 |
grep
lldpd |
grep
"Not monitored"
&> /dev/null
if
[
$?
-eq
0
]
;
then
echo
"lldpd was not monitored, enabling monitoring"
# the process was not monitored, enable monitoring
# this will generate extra log entries from monit
$MONIT
monitor lldpd
fi
}
}
stop
()
{
stop
()
{
...
@@ -67,7 +89,7 @@ restart() {
...
@@ -67,7 +89,7 @@ restart() {
case
"
$1
"
in
case
"
$1
"
in
start
)
start
)
start
start
"
$2
"
;;
;;
stop
)
stop
)
stop
stop
...
@@ -76,7 +98,8 @@ case "$1" in
...
@@ -76,7 +98,8 @@ case "$1" in
restart
restart
;;
;;
*
)
*
)
echo
$"Usage:
$0
{start|stop|restart}"
echo
"Usage:
$0
{start <force>|stop|restart}"
echo
" start force -- enable lldpd even it is disabled in the dot-config"
exit
1
exit
1
;;
;;
esac
esac
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment