Re: [Mojolicious] Re: Deployment: launch hypnotoad on boot
On Thu, Aug 4, 2016 at 8:27 PM, Dan Bookwrote: > 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. Great -- thanks again for the insight! Makes sense about supporting it in core, but just thought I'd start the conversation about it! :D -- 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 mojolicious+unsubscr...@googlegroups.com. To post to this group, send email to mojolicious@googlegroups.com. Visit this group at https://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.
Re: [Mojolicious] Re: Deployment: launch hypnotoad on boot
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 Adamswrote: > > On Thu, Aug 4, 2016 at 7:41 PM, Dan Book 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 mojolicious+unsubscr...@googlegroups.com. > To post to this group, send email to mojolicious@googlegroups.com. > 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 mojolicious+unsubscr...@googlegroups.com. To post to this group, send email to mojolicious@googlegroups.com. Visit this group at https://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.
Re: [Mojolicious] Re: Deployment: launch hypnotoad on boot
On Thu, Aug 4, 2016 at 7:41 PM, Dan Bookwrote: > 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 mojolicious+unsubscr...@googlegroups.com. To post to this group, send email to mojolicious@googlegroups.com. Visit this group at https://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.
Re: [Mojolicious] Re: Deployment: launch hypnotoad on boot
Systemd has an option for this, see Restart= here https://www.freedesktop.org/software/systemd/man/systemd.service.html On Thu, Aug 4, 2016 at 7:42 PM, Stefan Adamswrote: > I've noticed that sometimes my hypnotoad just dies, no warning. Is there > a supported directive for systemd to allow systemd to auto-restart the > service if the process hangs or disappears? > > On Sat, Jul 30, 2016 at 4:15 PM, sri wrote: > >> Mojolicious 7.01 will have better systemd support and we'll add unit file >> examples to the docs. >> >> https://github.com/kraih/mojo/compare/d87c59fc0fa1c4450d59 >> 5fc7b3bbdd24faf64e7a...7299bf4442b09ee8451953aba99f97abe9864 >> 7bf#diff-b659d9bfeffa6b78a1f2950c7e72259bR151 >> > > > -- > 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 mojolicious+unsubscr...@googlegroups.com. > To post to this group, send email to mojolicious@googlegroups.com. > 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 mojolicious+unsubscr...@googlegroups.com. To post to this group, send email to mojolicious@googlegroups.com. Visit this group at https://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.
Re: [Mojolicious] Re: Deployment: launch hypnotoad on boot
I've noticed that sometimes my hypnotoad just dies, no warning. Is there a supported directive for systemd to allow systemd to auto-restart the service if the process hangs or disappears? On Sat, Jul 30, 2016 at 4:15 PM, sriwrote: > Mojolicious 7.01 will have better systemd support and we'll add unit file > examples to the docs. > > https://github.com/kraih/mojo/compare/d87c59fc0fa1c4450d595fc7b3bbdd > 24faf64e7a...7299bf4442b09ee8451953aba99f97abe98647bf#diff- > b659d9bfeffa6b78a1f2950c7e72259bR151 > -- 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 mojolicious+unsubscr...@googlegroups.com. To post to this group, send email to mojolicious@googlegroups.com. Visit this group at https://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.