Skip to content

Conversation

@stepanblyschak
Copy link
Collaborator

DEPENDS ON #24190

Why I did it

Most Linux daemons support notifying init (usually systemd) about readiness. This is when systemd makes the process enter Started state. This is useful as sync mechanism between deamons.

We do have similar use cases for SONiC with supervisord. But in supervisord this works only with startsecs delay. This partially addresses #13765

Work item tracking
  • Microsoft ADO (number only):

How I did it

Implemented sd_notify

How to verify it

2025-09-25 15:24:39,920 INFO RPC interface 'supervisor' initialized
2025-09-25 15:24:39,921 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2025-09-25 15:24:39,922 INFO supervisord started with pid 1
2025-09-25 15:24:39,924 INFO spawned: 'dependent-startup' with pid 13
2025-09-25 15:24:39,928 INFO spawned: 'supervisor-proc-exit-listener' with pid 14
2025-09-25 15:24:41,451 INFO success: dependent-startup entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-09-25 15:24:41,452 INFO success: supervisor-proc-exit-listener entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-09-25 15:24:41,461 INFO spawned: 'rsyslogd' with pid 17
2025-09-25 15:24:41,478 INFO success: rsyslogd entered RUNNING state, process sent READY=1
2025-09-25 15:24:41,561 INFO spawned: 'start' with pid 21
2025-09-25 15:24:41,562 INFO success: start entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2025-09-25 15:24:42,405 INFO exited: start (exit status 0; expected)
2025-09-25 15:24:43,445 INFO spawned: 'lldpd' with pid 26
2025-09-25 15:24:43,530 INFO success: lldpd entered RUNNING state, process sent READY=1
2025-09-25 15:24:43,605 INFO spawned: 'waitfor_lldp_ready' with pid 29
2025-09-25 15:24:43,606 INFO success: waitfor_lldp_ready entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2025-09-25 15:24:44,145 INFO exited: waitfor_lldp_ready (exit status 0; expected)
2025-09-25 15:24:45,178 INFO spawned: 'lldp-syncd' with pid 32
2025-09-25 15:24:46,217 INFO success: lldp-syncd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-09-25 15:24:47,255 INFO spawned: 'lldpmgrd' with pid 36
2025-09-25 15:24:48,871 INFO success: lldpmgrd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-09-25 15:24:49,954 INFO exited: dependent-startup (exit status 0; expected)

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

  • 202205
  • 202211
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

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

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@qiluo-msft qiluo-msft requested a review from saiarcot895 October 2, 2025 20:30
From: Stepan Blyschak <[email protected]>
Date: Mon, 29 Sep 2025 14:09:22 +0000
Subject: [PATCH] Implement SD_NOTIFY

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you submit (just submit) a PR to https://github.com/Supervisor/supervisor ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

+ def close_notify_socket(self):
+ if self.notify_sock is None:
+ return
+ self.notify_sock.close()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will you self.notify_sock = None after close it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

url = https://github.com/Marvell-switching/mrvl-teralynx.git
[submodule "src/supervisor"]
path = src/supervisor
url = https://github.com/Supervisor/supervisor
Copy link
Collaborator

Choose a reason for hiding this comment

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

url

Do you want to add "branch"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure why needed, I pin submodule to specific commit

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@stepanblyschak
Copy link
Collaborator Author

@StormLiangMS Can this be used a a sync mechanism between FRR and bgpcfgd to address #23938?

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liat-grozovik
Copy link
Collaborator

@qiluo-msft can you please approve so i can merge? i want it to get to 202511 before it is branched out.

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.

4 participants