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

[mux]: Fix mark_dhcp_packet #9373

Merged
merged 3 commits into from
Nov 29, 2021

Conversation

theasianpianist
Copy link
Contributor

@theasianpianist theasianpianist commented Nov 24, 2021

Fixes #9374

Why I did it

Two issues prevent the mux systemd service from starting properly:

  • The mux.service unit file contains two [Service] sections, making it invalid
  • The mark_dhcp_packet.py file is not executable in the image

How I did it

  • Consolidate the two [Service] sections by moving the ExecStartPre line for mark_dhcp_packet.py to the first section and removing the second.
  • Make the mark_dhcp_packet.py file executable
  • Also clean up mark_dhcp_packet.py
    • Remove unused imports
    • Fix spacing and line lengths to conform to PEP8

How to verify it

  • Ensure that the mux service start properly:
admin@sonic:~$ systemctl status mux
● mux.service - MUX Cable Container
     Loaded: loaded (/lib/systemd/system/mux.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2021-11-24 20:16:51 UTC; 5min ago
    Process: 118541 ExecStartPre=/usr/local/bin/write_standby.py (code=exited, status=0/SUCCESS)
    Process: 120521 ExecStartPre=/usr/local/bin/mark_dhcp_packet.py (code=exited, status=0/SUCCESS)
    Process: 120649 ExecStartPre=/usr/bin/mux.sh start (code=exited, status=0/SUCCESS)
   Main PID: 120723 (mux.sh)
      Tasks: 2 (limit: 19193)
     Memory: 18.1M
     CGroup: /system.slice/mux.service
             ├─120723 /bin/bash /usr/bin/mux.sh wait
             └─120724 /usr/bin/python3 /usr/local/bin/container wait mux

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

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
@lgtm-com
Copy link

lgtm-com bot commented Nov 24, 2021

This pull request fixes 3 alerts when merging 921091a into 80dfbc8 - view on LGTM.com

fixed alerts:

  • 3 for Unused import

@theasianpianist theasianpianist merged commit 6e1a477 into sonic-net:master Nov 29, 2021
qiluo-msft pushed a commit that referenced this pull request Dec 1, 2021
- Consolidate the two [Service] sections by moving the ExecStartPre line for mark_dhcp_packet.py to the first section and removing the second.
- Make the mark_dhcp_packet.py file executable
- Also clean up mark_dhcp_packet.py
    - Remove unused imports
    - Fix spacing and line lengths to conform to PEP8
Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[mux] Mux service fails to start because of invalid service file and non-executable file
3 participants