muesli / beehive

A flexible event/agent & automation system with lots of bees 🐝
GNU Affero General Public License v3.0
6.28k stars 319 forks source link

Systemd's Watchdog bee #273

Closed rubiojr closed 4 years ago

rubiojr commented 4 years ago

Beehive integration with Systemd's watchdog.

Linux only.

http://0pointer.de/blog/projects/watchdog.html

muesli commented 4 years ago

Thinking about this a bit more, maybe this should rather be core functionality instead of a bee?

rubiojr commented 4 years ago

Thinking about this a bit more, maybe this should rather be core functionality instead of a bee?

Yeah, I thought about it, but given that multi OS support for this would be challenging I opted for this approach.

If you'd like to see this integrated into the core, conditionally enabling it when systemd is detected, I'd be happy to give it a try, it'd definitely make automatic configuration easier.

muesli commented 4 years ago

We could solve that in a similar fashion as we only include some hives on particular platforms (hives_linux.go etc). I think it makes sense to move this to core, but maybe a systemd bee could still be cool: maybe we can trigger events when services are changing state, like (re)starting or stopping?

We could theoretically also start / stop services, even though we'd usually be limited to interacting with user services (we're not running as root after all).

rubiojr commented 4 years ago

Good ideas. I’ll start by abstracting the watchdog so we can add it to the core.

rubiojr commented 4 years ago

cc https://github.com/muesli/beehive/pull/275

rubiojr commented 4 years ago

https://github.com/muesli/beehive/pull/275 was merged so closing this.