![]() |
|
Traversal Server Watchdog & alternative inits - Printable Version +- Dolphin, the GameCube and Wii emulator - Forums (https://forums.dolphin-emu.org) +-- Forum: Dolphin Emulator Discussion and Support (https://forums.dolphin-emu.org/Forum-dolphin-emulator-discussion-and-support) +--- Forum: Development Discussion (https://forums.dolphin-emu.org/Forum-development-discussion) +--- Thread: Traversal Server Watchdog & alternative inits (/Thread-traversal-server-watchdog-alternative-inits) |
Traversal Server Watchdog & alternative inits - vladtheimpaler - 09-30-2018 Hello dolphin-emu forum-goers & developers, I would like to build support for other init systems for the traversal server watchdog, namely Runit which runs things in the foreground & SysV / SysV+OpenRC, if I must fork something from Systemd then so be it, I would like to take on this challenge! Can someone please show me the systemd traversal server watchdog init scripts? I would love to see them, also if anyone knows anything about porting the traversal server watchdog to other init systems I would love to hear it! Anyone with a good understanding on what it exactly does down to the fine details would be helpful too, thank you! RE: Traversal Server Watchdog & alternative inits - Neui - 09-30-2018 Since I've already looked at the traversal server before and noticed the watchdog, and I've got time, here's an short overview of how it probably works: https://github.com/dolphin-emu/dolphin/pull/6424/commits/f221fac02e39f8a965560741d46c15536c3a5cff ← Adding systemd detection to their build system https://github.com/dolphin-emu/dolphin/pull/6424/commits/9e0739f5e578acc5289b13457690710fbadcdfdc ← The actual code https://www.freedesktop.org/software/systemd/man/sd_notify.html ← What sd_notify does/accepts https://www.freedesktop.org/software/systemd/man/systemd.service.html ← Configuring the watchdog (WatchdogSec=) (It seems there isn't a default .service file in the repo) Basically the server does sd_notify(0, "READY=1"); to signalise that it's running now (and activates the watchdog if configured) and for every loop iteration it does sd_notify(0, "WATCHDOG=1"); which updates the watchdog timestamp in the "service manager" in systemd. If the difference between the watchdog timestamp and the current time is larger than the configured value in WatchdogSec= in the .service file, then it terminates the server with SIGABRT, and, if Restart=on-watchdog has been specified in the .service file, restarted. RE: Traversal Server Watchdog & alternative inits - vladtheimpaler - 10-06-2018 Thank you Neui! Very detailed! I will look into this hopefully sometime this week... Wonder if the watchdog will work with Runit, which runs services in foreground instead of forking to background. Runit is really a great init system, I think adding support for it is definitely worth it for me to do. |