PDA

View Full Version : How-to REMOTE restart a server


12-16-2003, 10:05 AM
Has anyone had success with REMOTE RCON or third party tool to shutdown and restart a server? (I don't mean using /rcon exec... http://www.codadmin.com/nuke/modules.php?name=Forums&file=viewtopic&t=857 )

Does anyone have any info on this topic? Thanks!

UnDead
12-16-2003, 04:34 PM
Hmm this will depend. If you are renting just a CoD server, and you don't have full access to the box, you will have to rely on the vendor of your server to supply a control panel for you to stop and start your server.

We currently rent 3.0 GHz hyperthreaded server which we run multiple games off of. We have the ability to remote desktop the server so we can see the game console window and do what we need. So in our case it works fine since we have complete control of our server... If you don't you will want to request your vendor to create you a control panel so you can remotely.

Hope this helps. But I wasn't quite sure if this is what you are looking for.

Tighten
12-16-2003, 07:00 PM
Well - it would be a bit "ghetto" but, your server provider could put a restart command value in the hard line parameters ( -Restart 3 )

Then you could simply kill the server - which should restart by itself.

If you are looking for a start/stop function so you can start and stop the server whenever and for however long you want, you can't make something like that without access to the raw box (server) and its files and tree structure.

We offer that ability with our control panel, I really don't know how people get away with out offering it?

Your other route is the dedicated box(like mentioned above). With that you can either connect via terminal services, PcAnywhere, VNC or a similar program.

12-16-2003, 10:18 PM
Thank you for your replies, Gentlemen.

restart command value in the hard line parameters ( -Restart 3 )

This goes in the shortcut properties along the the ip, port and cfg name? How does it work and what is the correct syntax, please?

This control panel also sounds very interesting. Where could my vendor obtain such software? Is there a name for it?

Tighten
12-16-2003, 10:27 PM
Its not a program per se', it is something we built using perl, java etc...

The restart command is something they would need to add to the arguments. I am not sure if it works in a shortcut, I don't use shortcuts.

It works by telling the program to "restart" if the server crashes. the 3 was just an example - that is how many times it will try to start the server before the program gives up.

12-18-2003, 10:00 AM
The restart command is something they would need to add to the arguments.

Can you give an example or further explain this concept please?

EDIT: We are talking Windows platform, guys.

Tighten
12-18-2003, 01:30 PM
I don't have much experience with Linux - so my references are directed to a Windows server enviroment.

The restart command is used for an application that has been installed as a service.

Basicaly, it is an argument you put in the properties, just like you would an IP or Port or exec command.

-restart tells the service to start the application once it fails or crashes. The number next to restart ( -restart 3 ) tells the service how mnay times to try and restart the program, after that variable limit is reached - it gives up. Obviously after three attempts (my golden number) there is something seriously wrong.

ruggbutt
12-18-2003, 01:41 PM
We use Radmin to restart our server. We are allowed complete access to it.

Tighten
12-18-2003, 01:55 PM
Radmin is similar to PcAnywhere or VNC. I don't think he has access to the box or will be allowed access to the box.

He was looking for a utility that would allow him to simply start / stop the server with out having access to the entire server.

imported_Bouncer
12-18-2003, 08:27 PM
Here is an server script (.asp) that will allow you to run a batch file on your server. I use the Net Stop Service or start whichever. Make sure you dont leave the batch files in the web directory.

Use with Caution


Dim sExecStr : sExecStr = "cmd /c " & chr(34) & Server.MapPath("yourfilename.bat") & chr(34)
Dim oShell
Dim oExec
Dim tmpStr
Dim RetCode

Set oShell = Server.CreateObject("WScript.Shell")
Set oExec = oShell.Exec(sExecStr)
Do
tmpStr = oExec.StdOut.ReadAll()
Loop While Not oExec.Stdout.atEndOfStream
RetCode = oExec.stderr.readall

Set oExec = Nothing
Set oShell = Nothing

If Len(RetCode) > 1 Then
tmpStr = RetCode
End If

'{{ write our output to the screen
Response.Write Replace(tmpStr,vbCrLf,"<br>") & vbCrLf


Note: PHP does not permit the html tags to be shown in this code.

12-18-2003, 10:05 PM
I do have access to the box via FTP...

Tighten, that -restart 3 command is something the admin should use in their 'properties' as mentioned regardless, correct? Makes a lot of sense. How can the admin set the gameserver to run as a service? (installed as a service) It's running as an application now and started from the desktop shortcut.

I'm asking about this topic because I am looking for something my admin can set up for me to be able to restart the gameserver after I upload .pk3 files in the case he is afk.

Thanks UnDead, Tighten, ruggbutt and Bouncer. I appreciate your help.

foolio
12-25-2003, 08:27 PM
I use a program called putty found here http://www.chiark.greenend.org.uk/~sgtatham/putty/

switch the connection to ssh, use the same logon and pw as you would for ftp access to the server

the restart cmd is
./runserver restart

Tighten
12-25-2003, 09:34 PM
^^^^^^^ Above is for Linux.

I don't think the "restart" command works for shortcuts. *(which is how your game appears to be configured)

For the exception of a batch file (most GSP's prohibit) I really don't know of another way.

There are many programs that allow you to install and run app's as a service, but, this is still something a GSP would need to configure, as launching executables would be foolish to allow.

I am sorry but, I don't think I would be of any further assistance on this. Talk to whoever is providing your server, maybe they can work something out.