Advertisement
Guest User

Untitled

a guest
Jul 25th, 2014
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. here im using the linux tool monit to monitor the udp accessibility, if it's closed like a crash without the pid crashing it works well to restart it, so far never got problems with, has always restarted the crashes, posted a bit more infos in the comments here on page 3-2 http://steamcommunity.com/sharedfiles/filedetails/?id=201284083
  2.  
  3. basically this is how it looks like for multiple server it monitors
  4.  
  5.  
  6. Code:
  7. # Settings
  8. set daemon 30 # check services at 1-minute intervals
  9. with start delay 30 # optional: delay the first check by 30s.
  10. set logfile /var/log/monit.log
  11.  
  12. # Checks
  13. check host starbound with address 127.0.0.1
  14. start = "/usr/sbin/chroot /chroot-starbound /etc/init.d/starbound start"
  15. stop = "/usr/sbin/chroot /chroot-starbound /etc/init.d/starbound force-stop"
  16. # Save starbound_server.log
  17. if failed port 55102 type udp with timeout 5 seconds then exec "/bin/bash -c 'cp -f /chroot-starbound/starbound/starbound_server.log /chroot-starbound/starbound/starbound_server_crashed_$$$(date +%s%N).log'"
  18. # Restart
  19. if failed port 55102 type udp with timeout 5 seconds retry 2 then restart
  20.  
  21. check host mbwarband with address 127.0.0.1
  22. start = "/usr/sbin/chroot /chroot-mbwarband /etc/init.d/mbwarband start"
  23. stop = "/usr/sbin/chroot /chroot-mbwarband /etc/init.d/mbwarband force-stop"
  24. # Save starbound_server.log
  25. if failed port 7240 type tcp with timeout 5 seconds retry 2 then restart
  26.  
  27. check host mbwarband2 with address 127.0.0.1
  28. start = "/usr/sbin/chroot /chroot-mbwarband2 /etc/init.d/mbwarband2 start"
  29. stop = "/usr/sbin/chroot /chroot-mbwarband2 /etc/init.d/mbwarband2 force-stop"
  30. # Save starbound_server.log
  31. if failed port 7340 type tcp with timeout 5 seconds retry 2 then restart
  32.  
  33. I check udp for Starbound because it does not write an extra log entry in the file from 127.0.0.1 and I checked, when the tcp crashes, udp too
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement