[ECS]Feature Request: Support sd_notify for systemd watchdog
- Dominant language
- Shell
- Stars
- 5.4k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
Currently the ECS Agent can be managed by a systemd unit file, but we cannot use the full features of systemd. Systemd has a feature called ```WatchdogSec```
> Configures the watchdog timeout for a service. The watchdog is activated when the start-up is completed. The service must call sd_notify(3) regularly with "WATCHDOG=1" (i.e. the "keep-alive ping"). If the time between two such calls is larger than the configured time, then the service is placed in a failed state and it will be terminated with SIGABRT. By setting Restart= to on-failure, on-watchdog, on-abnormal or always, the service will be automatically restarted. The time configured here will be passed to the executed service process in the WATCHDOG_USEC= environment variable. This allows daemons to automatically enable the keep-alive pinging logic if watchdog support is enabled for the service. If this option is used, NotifyAccess= (see below) should be set to open access to the notification socket provided by systemd. If NotifyAccess= is not set, it will be implicitly set to main. Defaults to 0, which disables this feature. The service can check whether the service manager expects watchdog keep-alive notifications. See sd_watchdog_enabled(3) for details. sd_event_set_watchdog(3) may be used to enable automatic watchdog notification support.
that would allow systemd to action on hung ECS Agents.
Contributor guide
Research direction
Start by locating the ECS Agent's systemd unit integration, then read the issue's references to WatchdogSec, sd_notify(3), and WATCHDOG_USEC=. Define how watchdog notifications should behave for the agent and how a hung agent should be detected and restarted; done means the requested systemd watchdog support is implemented and verified.
Written by the indexing model from the issue text.
Assessment
- Domain
- devops, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100