sonic-net / sonic-mgmt

Configuration management examples for SONiC
Other
173 stars 689 forks source link

Fix dhcp process name when called by supervisorctl #13547

Open yanmo96 opened 5 days ago

yanmo96 commented 5 days ago

Description of PR

Summary: To address the issue where the dhcp6relay and dhcprelayd processes are not running as expected within dhcp_relay, it is necessary to ensure that the correct prefix dhcp-relay: is included when attempting to start these processes using supervisorctl. This prefix is crucial for the supervisor to recognize and manage the processes correctly. By adding a condition to include the prefix, supervisorctl can be used effectively to start the dhcp6relay and dhcprelayd processes as intended.

Fixes # (issue) {"changed": true, "cmd": "docker exec dhcp_relay supervisorctl start dhcp6relay", "delta": "0:00:00.381158", "end": "2024-06-19 03:45:44.319270", "failed": true, "msg": "non-zero return code", "rc": 1, "start": "2024-06-19 03:45:43.938112", "stderr": "", "stderr_lines": [], "stdout": "dhcp6relay: ERROR (no such process)", "stdout_lines": ["dhcp6relay: ERROR (no such process)"]}

Type of change

Back port request

Approach

What is the motivation for this PR?

Make sure critical process can starts it if it was not running.

How did you do it?

By adding a check on the container name the process name. And add the dhcp-relay: as necessary.

How did you verify/test it?

Run with docker exec command on testbed. We can see, before the change it will have the error "no such process" which is what we have been seeing in the test log, by adding the prefix will correctly lactated the process.

root@str3-msn4700-03:/etc/supervisor# supervisorctl start dhcp6relay
dhcp6relay: ERROR (no such process)
root@str3-msn4700-03:/etc/supervisor# supervisorctl start dhcp-relay:dhcp6relay
dhcp-relay:dhcp6relay: ERROR (already started)

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

bingwang-ms commented 5 days ago

LGTM. Please add label request for 202311 and request for 202405