Recent

Author Topic: sd_notify for systemd watchdog  (Read 1838 times)

TheMouseAUS

  • Jr. Member
  • **
  • Posts: 81
sd_notify for systemd watchdog
« on: December 29, 2024, 01:59:12 am »
How can I easily call sd_notify (specifically watchdog=1) from a command line app I have created. I am wanting systemd to restart the app if the watchdog stops  responding for some reason. Thanks in advance :-)

dsiders

  • Hero Member
  • *****
  • Posts: 1337
Re: sd_notify for systemd watchdog
« Reply #1 on: December 29, 2024, 02:16:37 am »
How can I easily call sd_notify (specifically watchdog=1) from a command line app I have created. I am wanting systemd to restart the app if the watchdog stops  responding for some reason. Thanks in advance :-)

systemd-notify --help

Might need sudo.
Preview the next Lazarus documentation release at: https://dsiders.gitlab.io/lazdocsnext

TheMouseAUS

  • Jr. Member
  • **
  • Posts: 81
Re: sd_notify for systemd watchdog
« Reply #2 on: December 29, 2024, 03:03:00 am »
so i run it as an external app?

dsiders

  • Hero Member
  • *****
  • Posts: 1337
Re: sd_notify for systemd watchdog
« Reply #3 on: December 29, 2024, 03:28:19 am »
so i run it as an external app?

You can use TProcess to run it. I'm not aware of na FPC interface to the library code... but there's a lot I don't know. :)
Preview the next Lazarus documentation release at: https://dsiders.gitlab.io/lazdocsnext

 

TinyPortal © 2005-2018