0

I am wondering if there is some way to do this.

I need to write a script or something that:

Can start some processes with some args, for example:

start server.exe -port 8899 -name "Epic Server 1"
start server.exe -port 8897 -name "Epic Server 2"

If one of them crashes, this script automatically restarts it with the specified parameters.

This will always run on a windows machine so a Windows-Only solution is acceptable.

I'm wondering if Ruby or similar has a gem for this sort of thing... I could not find one.

jmasterx
  • 143
  • 1
  • 5

2 Answers2

2

So you need a script or program that can:

  • Search for running processes with a certain start command line
  • Start a new process with a certain command line
  • Manage a list of programs and their parameters to monitor
  • periodically perform step one, (wait a little, then check again)
  • run in the background

Pretty much every programming/script language available for Windows can do this. In the box you have the options of PowerShell, vbscript, javascript, c#, vb.net

Or you can use third party tools like Ruby or Python, but then you have to install their runtime first.

After you have chosen a language, you can research the individual steps and put them together.

Peter Hahndorf
  • 14,058
  • 3
  • 41
  • 58
0

If the in the *nux env, you can refer to the supervisor for help http://supervisord.org/. As as for the win system, try write the windows service.

hxc
  • 1
  • 1