• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Development Discussion v
« Previous 1 ... 15 16 17 18 19 ... 116 Next »

Traversal Server Watchdog & alternative inits
View New Posts | View Today's Posts

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Traversal Server Watchdog & alternative inits
09-30-2018, 12:40 AM
#1
vladtheimpaler Offline
Junior Member
**
Posts: 8
Threads: 4
Joined: Jul 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!
Find
Reply
09-30-2018, 02:24 AM
#2
Neui Offline
Quiet
***
Posts: 174
Threads: 1
Joined: Apr 2015
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.
Find
Reply
10-06-2018, 09:37 PM
#3
vladtheimpaler Offline
Junior Member
**
Posts: 8
Threads: 4
Joined: Jul 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. 
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode