News for hackers. Stuff that matters.
Re:Scaling Mastodon with systemd template units by 20after4 on Thursday December 01, 2022 @09:00AM (#33816275)
There is a watchdog feature where (if I remember correctly) systemd listens on a socket and the service must write to that socket periodically or it gets automatically killed and restarted. Unfortunately, the feature is rather obscure and not well documented.

I found that the sd-notify[1] package on NPM works well. If your app happens to use NodeJS then it's pretty simple to set up. If not, looking at the way that package is implemented is probably a good way to figure out how the feature works so that you can do the same thing in your own application. Maybe the documentation for the feature has improved, however, the last time I checked (only a few months ago) everything I found was bad. I did stop looking once I found that the NPM package works well.

[1] https://www.npmjs.com/package/sd-notify

There are no comments on this comment yet.