AKS DataBasis

CentrED => Support => Topic started by: Sirius on March 23, 2009, 12:57:21 PM

Title: Scriptbased shutdown via telnet or similar possible?
Post by: Sirius on March 23, 2009, 12:57:21 PM
I'm looking for a solution to shut down CentrED via a self programmed webinterface. Is there any way to connect via telnet or something similar to CentrED and shut it down "softly"? I don't want to kill the process via commandline commands (I don't know if this can cause errors in the MUL-files if a user is currently working on them).
Or does anybody know another solution for a scriptbased shutdown?

Thanks in advance,
Sirius
Title: Re: Scriptbased shutdown via telnet or similar possible?
Post by: Hitman on March 23, 2009, 02:28:37 PM
Shutting it down via commandline should be perfectly fine. I catch ctrl+c (which should be SIGTERM on *nix) and perform a clean shutdown then. So a kill -15 or killall -15 should do the trick.
Title: Re: Scriptbased shutdown via telnet or similar possible?
Post by: Tare on March 24, 2009, 07:40:08 AM
Didnt the CentrED-client has the option to shutdown the CedServer, loged in as admin? In this way you can see if someone ist working, tell him to log out for a while and shutdown the server then.
Title: Re: Scriptbased shutdown via telnet or similar possible?
Post by: Hitman on March 24, 2009, 09:11:20 AM
Indeed, but then you would have to implement to protocol to communicate with the server (which is also possible ofcourse). But on the other hand: is it really that bad if a user gets kicked out during work? Every large building requires several hours, so giving someone some more seconds or even minutes to finish wouldn't cut it anyway ;)
Title: Re: Scriptbased shutdown via telnet or similar possible?
Post by: Tare on March 24, 2009, 01:48:46 PM
Well depends on the case, for example a Large Scale Command shouldnt be interrupt, or is there a controll so that the command can work till end and then the CedServer shuts down?
Title: Re: Scriptbased shutdown via telnet or similar possible?
Post by: Hitman on March 24, 2009, 02:08:40 PM
I'm not sure. But since LSC can only be started by admins, that shouldn't cause trouble. Admins should be able to speak with each other ;-)
But of course you can simply test what happens if you press ctrl+c while a LSC is being processed.
Title: Re: Scriptbased shutdown via telnet or similar possible?
Post by: Sirius on March 27, 2009, 12:55:43 PM
ok, thanks. I will try this out via automatic ssh connection and kill command.

Do you have any idea how to perform this on windows automaticaly from remote?
Title: Re: Scriptbased shutdown via telnet or similar possible?
Post by: Hitman on March 27, 2009, 01:20:59 PM
Automating Windows in that regard is always a bit tricky. I would say the "easiest" thing for now is, to find the window and send ctrl+c. This could for example be done via AutoIt (//http://www.autoitscript.com/autoit3) and a script using WinActivate and Send. Or you write a little program using FindWindow and PostMessage/SendKeys/whatever.