-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Changes for LLDP docker to support multi-npu platforms #4530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
#Generate supervisord.conf based on device metadata | ||
mkdir -p /etc/supervisor/conf.d/ | ||
sonic-cfggen -d -t /usr/share/sonic/templates/supervisord.conf.j2 > /etc/supervisor/conf.d/supervisord.conf | ||
exec /usr/bin/supervisord |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,11 @@ stderr_logfile=syslog | |
# - `-dd` means to stay in foreground, log warnings to console | ||
# - `-ddd` means to stay in foreground, log warnings and info to console | ||
# - `-dddd` means to stay in foreground, log all to console | ||
{% if DEVICE_METADATA['localhost']['sub_role'] is defined and DEVICE_METADATA['localhost']['sub_role']|length %} | ||
command=/usr/sbin/lldpd -d -I Ethernet* -C Ethernet* | ||
{% else %} | ||
command=/usr/sbin/lldpd -d -I Ethernet*,eth0 -C eth0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what about rewritong this command line using sed,inside of supervisord.conf? And don't use jinja2 template for that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i suggest to make this code generic, detect if there is eth0, if there is then use eth0, if there is no, do not add eth0 into the command line. it is better than templating based on the sub_role. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pavel-shirshov : I tried couple of things to avoid jinja2 template @lguohan: eth0 is present both in container and host. So we cannot distinguish that, Do we need to check if container is using --net= host or not ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pavel-shirshov , what is the concern for using jinja2 template for supervisord.conf? if we can first generate and start supervisord, then we do not need to reload. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pavel-shirshov Based on above comment will be using jinja template for suerpvisor.conf There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lguohan It looks like we're going to have another snowflake in SONiC. Everywhere we start with "start.sh" script. Here the "start.sh" is not run on the start (So the name is misleading). And we have another start script, with another name. This is confusing. |
||
{% endif %} | ||
priority=3 | ||
autostart=false | ||
autorestart=false | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
per_namespace/lldp.service.j2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please put the script into /usr/bin?
We never use /usr/local for anything (but agree it is more appropriate to put our own code).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pavel-shirshov Done