Skip to content
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

Login messages config #4

Closed
wants to merge 1 commit into from
Closed

Login messages config #4

wants to merge 1 commit into from

Conversation

fastiuk
Copy link
Owner

@fastiuk fastiuk commented Jul 2, 2022

This PR depends on fastiuk/sonic-swss-common#2, fastiuk/sonic-host-services#1

Why I did it

  • Add an ability to configure login messages: /etc/motd, /etc/issue*
  • Be able to use table defines from swsscommon

How to verify it

Build SONiC
or
When SONiC was already built:

rm -f target/python-wheels/bullseye/sonic_yang_models-1.0-py3-none-any.whl
BLDENV=bullseye make -f Makefile.work target/python-wheels/bullseye/sonic_yang_models-1.0-py3-none-any.whl
rm -f target/python-wheels/bullseye/sonic_host_services-1.0-py3-none-any.whl
BLDENV=bullseye make -f Makefile.work target/python-wheels/bullseye/sonic_host_services-1.0-py3-none-any.whl

Login into the switch.
Set messages:

redis-cli -n 4 HSET "LOGIN_MESSAGE|pre_login" "message" "Test pre login"
redis-cli -n 4 HSET "LOGIN_MESSAGE|post_login" "message" "Test post login"

Logout/login and see the results:
Screenshot 2022-07-02 at 22 58 11
Clear messages:

redis-cli -n 4 HSET "LOGIN_MESSAGE|pre_login" "message" ""
redis-cli -n 4 HSET "LOGIN_MESSAGE|post_login" "message" ""

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

  • Add an ability to configure pre-login and post-login messages: /etc/motd, /etc/issue*

Link to config_db schema for YANG module changes

sonic-login_message.yang

Submodules PR's :

Repo PR title State
sonic-host-services Login messages config GitHub issue/pull request detail
sonic-swss-common Login messages config GitHub issue/pull request detail

A picture of a cute animal

1-46

@fastiuk
Copy link
Owner Author

fastiuk commented Jul 2, 2022

@stepanblyschak please review

@stepanblyschak
Copy link

@fastiuk What is the use case?

@fastiuk
Copy link
Owner Author

fastiuk commented Jul 4, 2022

@fastiuk What is the use case?

The use case is to customize/rebrand your switch.
For example: here is a default Login screen:
Screenshot 2022-07-04 at 18 05 24
After customizing it will look like this (or in any other way you want):
Screenshot 2022-07-04 at 18 33 51

@stepanblyschak
Copy link

@fastiuk What is the use case for a user to customize this message through config db?
If you want to create an NVIDIA distribution of SONiC you can modify this file at image build time.

@fastiuk
Copy link
Owner Author

fastiuk commented Jul 5, 2022

What is the use case for a user to customize this message through config db?
If you want to create an NVIDIA distribution of SONiC you can modify this file at image build time.

The use case is to be able to configure it at runtime. It is not a good user experience if it needs to rebuild an image in order to change the login messages. From the user's perspective of view: the user will grab the prebuilt image from github/artifactory/etc install it and then configure it out-of-box without a need to rebuild it.

Copy link

@stepanblyschak stepanblyschak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not include submodule update in this PR. Submodule update should be done in a separate PR.

I understand the motivation to change the "welcome" message for custom images. AFAIK Alibaba, Kuaishu, etc. - those companies build their own distribution based on SONiC and they change the welcome message. That is nice, because when you enter the switch you know is SONiC based you see which company's distribution you are on as every company has own modifications to the image.

However, I do not understand the benefit of having this configurable though CONFIG DB and letting the user to configure it. What does user gain by doing so? This seems purelly cosmetic and can be done by editing files mannually by the user since SONiC gives you full access to the filesystem. We will have to come up with an HLD with this proposal and review with community first before internal code review.

* Add YANG model for new ConfigDB table
* Covered with tests

Signed-off-by: Yevhen Fastiuk <[email protected]>
@fastiuk fastiuk force-pushed the login-message-config branch from a14232d to 0466097 Compare July 29, 2022 19:24
@fastiuk fastiuk changed the base branch from master to 202111 July 29, 2022 19:29
@fastiuk fastiuk changed the base branch from 202111 to master July 29, 2022 19:29
@fastiuk
Copy link
Owner Author

fastiuk commented Jul 29, 2022

Hostcfgd moved here: fastiuk/sonic-host-services#1

@fastiuk
Copy link
Owner Author

fastiuk commented Aug 30, 2022

Hey @stepanblyschak . Can we create community PR for this?

fastiuk pushed a commit that referenced this pull request Nov 20, 2022
#### Why I did it
Update sonic-host-services submodule to include below commits:
```
bc8698d Merge pull request sonic-net#21 from abdosi/feature
557a110 Fix the issue where if dest port is not specified in ACL rule than for multi-asic where we create NAT rule to forward traffic from Namespace to host fail with exception.
6e45acc (master) Merge pull request sonic-net#14 from abdosi/feature
4d6cad7 Merge remote-tracking branch 'upstream/master' into feature
bceb13e Install libyang to azure pipeline (sonic-net#20)
82299f5 Merge pull request #13 from SuvarnaMeenakshi/cacl_fabricns
15d3bf4 Merge branch 'master' into cacl_fabricns
de54082 Merge pull request sonic-net#16 from ZhaohuiS/feature/caclmgrd_external_client_warning_log
b4b368d Add warning log if destination port is not defined
d4bb96d Merge branch 'master' into cacl_fabricns
35c76cb Add unit-test and fix typo.
17d44c2 Made Changes to be Python 3.7 compatible
978afb5 Aligning Code
1fbf8fb Merge remote-tracking branch 'upstream/master' into feature
7b8c7d1 Added UT for the changes
91c4c42 Merge pull request #9 from ZhaohuiS/feature/caclmgrd_external_client
7c0b56a Add 4 test cases for external_client_acl, including single port and port range for ipv4 and ipv6
b71e507 Merge remote-tracking branch 'origin/master' into HEAD
d992dc0 Merge branch 'master' into feature/caclmgrd_external_client
bd7b172 DST_PORT is configuralbe in json config file for EXTERNAL_CLIENT_ACL
f9af7ae [CLI] Move hostname, mgmt interface/vrf config to hostcfgd (#2)
70ce6a3 Merge pull request #10 from sujinmkang/cold_reset
29be8d2 Added Support to render Feature Table using Device running metadata. Also added support to render 'has_asic_scope' field of Feature Table.
3437e35 [caclmgrd][chassis]: Add ip tables rules to accept internal docker traffic from fabric asic namespaces.
8720561 Fix and add hardware reboot cause determination tests
0dcc7fe remove the empty bracket if no hardware reboot cause minor
e47d831 fix the wrong expected result comparision
ef86b53 Fix startswith Attribute error
8a630bb fix mock patch
8543ddf update the reboot cause logic and update the unit test
53ad7cd fix the mock patch function
7c8003d fix the reboot-cause regix for test
1ba611f fix typo
25379d3 Add unit test case
a56133b Add hardware reboot cause as actual reboot cause for soft reboot failed
c7d3833 Support Restapi/gnmi control plane acls
f6ea036 caclmgrd: Don't block traffic to mgmt by default
a712fc4 Update test cases
adc058b caclmgrd: Don't block traffic to mgmt by default
06ff918 Merge pull request #7 from bluecmd/patch-1
e3e23bc ci: Rename sonic-buildimage repository
e83a858 Merge pull request #4 from kamelnetworks/acl-ip2me-test
f5a2e50 [caclmgrd]: Tests for IP2ME rules generation
```
@fastiuk fastiuk closed this May 17, 2023
@fastiuk fastiuk deleted the login-message-config branch May 23, 2023 22:19
fastiuk pushed a commit that referenced this pull request Jul 11, 2023
…est HEAD automatically (sonic-net#15725)

#### Why I did it
src/sonic-dash-api/sonic-dash-api
```
* 3f728d1 - (HEAD -> master, origin/master, origin/HEAD) Update vnet_direct in route.proto (#4) (11 days ago) [Ze Gan]
```
#### How I did it
#### How to verify it
#### Description for the changelog
fastiuk pushed a commit that referenced this pull request Dec 23, 2024
…et#21095)

Adding the below fix from FRR FRRouting/frr#17297

This is to fix the following crash which is a statistical issue

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M dplane_fpm_nl -M snmp'.
Program terminated with signal SIGABRT, Aborted.
#0  0x00007fccd7351e2c in ?? () from /lib/x86_64-linux-gnu/libc.so.6
[Current thread is 1 (Thread 0x7fccd6faf7c0 (LWP 36))]
(gdb) bt
#0  0x00007fccd7351e2c in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007fccd7302fb2 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007fccd72ed472 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#3  0x00007fccd75bb3a9 in _zlog_assert_failed (xref=xref@entry=0x7fccd7652380 <_xref.16>, extra=extra@entry=0x0) at ../lib/zlog.c:678
#4  0x00007fccd759b2fe in route_node_delete (node=<optimized out>) at ../lib/table.c:352
#5  0x00007fccd759b445 in route_unlock_node (node=0x0) at ../lib/table.h:258
#6  route_next (node=<optimized out>) at ../lib/table.c:436
#7  route_next (node=node@entry=0x56029d89e560) at ../lib/table.c:410
#8  0x000056029b6b6b7a in if_lookup_by_name_per_ns (ns=ns@entry=0x56029d873d90, ifname=ifname@entry=0x7fccc0029340 "PortChannel1020")
    at ../zebra/interface.c:312
#9  0x000056029b6b8b36 in zebra_if_dplane_ifp_handling (ctx=0x7fccc0029310) at ../zebra/interface.c:1867
#10 zebra_if_dplane_result (ctx=0x7fccc0029310) at ../zebra/interface.c:2221
#11 0x000056029b7137a9 in rib_process_dplane_results (thread=<optimized out>) at ../zebra/zebra_rib.c:4810
#12 0x00007fccd75a0e0d in thread_call (thread=thread@entry=0x7ffe8e553cc0) at ../lib/thread.c:1990
#13 0x00007fccd7559368 in frr_run (master=0x56029d65a040) at ../lib/libfrr.c:1198
sonic-net#14 0x000056029b6ac317 in main (argc=9, argv=0x7ffe8e5540d8) at ../zebra/main.c:478
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants