The Watchdog is an optional feature, but if you enable it (with WatchdogSec=), the Restart option will include that condition. Otherwise the on-failure setting is usually sufficient and will restart it when a systemd operation times out or the process exits with a non-zero exit code or is terminated by a signal (e.g. SIGKILL, SIGSEGV). As for supporting it in Hypnotoad itself, it would be difficult to support via a plugin since the manager process (which does not run the IOLoop) would need to be sending the notify. And I'm doubtful if such a systemd-specific feature would be something the team wants to implement in core.
On Thu, Aug 4, 2016 at 8:51 PM, Stefan Adams <[email protected]> wrote: > > On Thu, Aug 4, 2016 at 7:41 PM, Dan Book <[email protected]> wrote: > >> Systemd has an option for this, see Restart= here >> https://www.freedesktop.org/software/systemd/man/systemd.service.html >> > > Thanks, Dan! I understand that a daemon needs to be written to > specifically handle the watchdog ping. > > *Timeouts include missing the watchdog "keep-alive ping" deadline* > > > Do you know if this is necessary or if the other modes are generally > sufficient to ensure that the service restarts when it fails? > > Moreover, would building in watchdog support to hypnotoad be a good idea? > > *First of all, to make software watchdog-supervisable it needs to be > patched to send out "I am alive" signals in regular intervals in its event > loop. Patching this is relatively easy. First, a daemon needs to read the > WATCHDOG_USEC= environment variable. If it is set, it will contain the > watchdog interval in usec formatted as ASCII text string, as it is > configured for the service. The daemon should then > issuesd_notify("WATCHDOG=1") calls every half of that interval. A daemon > patched this way should transparently support watchdog functionality by > checking whether the environment variable is set and honouring the value it > is set to.* > > > -- http://0pointer.de/blog/projects/watchdog.html > > -- > You received this message because you are subscribed to the Google Groups > "Mojolicious" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/mojolicious. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.
