Chocolate Software Forums

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Command Line Interface  (Read 7673 times)

jordan

  • Junior Member
  • **
  • Offline Offline
  • Posts: 15
  • Have you flown your Helicopter Today?
Command Line Interface
« on: October 17, 2003, 11:48:46 PM »

Greetings Russel, and everyone!

I have an automatic recycle of the machine that is running my FSHost.  It occurs every six hours to make sure things stay stable.  The entire machine reboots.

I would like to stop the server cleanly, and even perhaps send a couple of warning messages before the recycle occurs.  If I could stop the server this way it would spare the users rough disconnects that can sometimes cause hangs and crashes on their end.  Is there way to control any of these functions through a command line call instead of through the interface?

I have read everything on this site before posting, hopefully I didn't miss something.

If not, would you agree that this would add a lot more flexibility for those that are attempting to use FSHost on a 24x7 basis under heavy loads?

Thanks for any consideration or feedback on the matter!
Logged
Jordan M.

Skydiver173

  • Full Member
  • ***
  • Offline Offline
  • Posts: 87
    • World Serious Pilots
Re: Command Line Interface
« Reply #1 on: October 18, 2003, 12:36:25 AM »

Every 6 hours? I'd at least go at 24 hours. I've been running stable now for 12.5 days now with no restarts. BTW guys... I just increased the virtual memory and everything seems great!

jordan, what O.S. are you using? I'm running WinXP and have no stablilty issues. You may want to change. Just a thought.

BTW...NICE CHOPPERS!!!!  :)  beautiful work!
« Last Edit: October 18, 2003, 12:37:40 AM by _skys_server_ »
Logged

jordan

  • Junior Member
  • **
  • Offline Offline
  • Posts: 15
  • Have you flown your Helicopter Today?
Re: Command Line Interface
« Reply #2 on: October 18, 2003, 03:42:12 AM »

I absolutely agree.  I am definitely not running it on the best OS right now, and plan to switch it over as soon as I'm able.   Would still love to have command line ability for the most important tasks such as stopping the server gracefully, and broadcast messaging.
Logged
Jordan M.

jonf

  • Guru
  • *****
  • Offline Offline
  • Posts: 211
    • Livewire Airlines
Re: Command Line Interface
« Reply #3 on: October 18, 2003, 04:56:22 PM »

Russell pointed out a program to me called FireDaemon (http://www.firedaemon.com) that I now use to run FSHost as a service. I think you might be able to use that. Since it's running as a service, it shuts down the applications it's running before the machine shuts down and seems to do a very good job of it.

As for alerting users, you can use the feature in the MISC section to automatically send messages to players every X minutes. Set it to broadcast your reboot times every hour so pilots know when to expect it.
Logged

Russell Gilbert

  • Administrator
  • Guru
  • *****
  • Offline Offline
  • Posts: 1457
    • FSHost
Re: Command Line Interface
« Reply #4 on: October 20, 2003, 04:29:25 AM »

Interesting idea.

It's a bit complicated technically, because I think what you really want to do is send FSHost a message after it's started.  So the command line isn't really the best place for it, since the command line parameters are only read at the initial startup.

But FSHost does have a way to do all of this, via the Remote Access admin web pages.  From there, you can send chat messages, stop the game servers, and even shut down FSHost completely.  The only trick is that you need to write a program to talk to FSHost through the web interface.

Or you could do something like what Jon suggested, and use the automatic chat announcements to tell the players that it's about to shutdown -- if you had FSHost starting and stopping on a particular cycle, you could probably even set the auto-announce time to something like 5 hours and 55 minutes, for example.

Russell
Logged

jordan

  • Junior Member
  • **
  • Offline Offline
  • Posts: 15
  • Have you flown your Helicopter Today?
Re: Command Line Interface
« Reply #5 on: October 22, 2003, 01:21:26 AM »

Thanks Russell,

I'm a programmer myself, so I understand that simple ideas aren't always simple to implement.  Perhaps you would consider this "wish" instead.

Could you add a hotkey key-combo in FSHost that would initiate a shutdown and/or Exit?  Such as Ctrl+Shift+X  and allow users to disable the "Are you sure?" dialogue?  That would allow most good scheduling software packages to do the shutdown automatically, even if it has to do it through the user interface instead of a command line.  You might consider adding an option to set a time in seconds until shutdown actually occurs, and give the admin a custom message that will be sent at the beginning of that sequence.  So the admin hits shutdown, which will begin in X number of seconds, and can have defined a message automatically sent that would state "Server Shutting Down in X Seconds, Will be back up in 5 minutes!."  I think you would agree that this type of option is pretty normal and very useful for multi-user server shutdowns on various types of systems.

As I said, I plan on getting this onto a much better platform in the coming days, but that type of flexibility would be sure to benefit the larger organizations that have to deal with busy servers and lots of confused users.

By the way we are going on week 4 with FSHost and the over-all response has been extremely positive.  Thank you for a great idea, and a great software package.  We have almost 3000 registered members, so the first few days were hectic, and our staff had to become over-night network engineers to help everyone with their various router and firewall configurations..but we all enjoy the new server more than Squawkbox....Hands Down!  despite the bad OS its running on, it is managing very well. THANK YOU!






Logged
Jordan M.

jordan

  • Junior Member
  • **
  • Offline Offline
  • Posts: 15
  • Have you flown your Helicopter Today?
Re: Command Line Interface
« Reply #6 on: October 22, 2003, 01:24:04 AM »

P.S.  The "Bad OS" comment referred to my OS specifically and not to all Windows variants.  Didn't want it to sound like a Linux vs. Windows slam.
Logged
Jordan M.

Russell Gilbert

  • Administrator
  • Guru
  • *****
  • Offline Offline
  • Posts: 1457
    • FSHost
Re: Command Line Interface
« Reply #7 on: October 22, 2003, 02:27:51 AM »

Hi Jordan,

There's actually a way you can disable the "Players are still connected. Close program anyway?" message when you stop the game servers.  Just add a registry entry called "MiscShutdownWarning" with the type "DWORD" and a value of zero, to this registry key:

HKEY_CURRENT_USER\Software\FSHost\FSHost\Settings

There's not currently a way to send a shutdown message (unless you use the automated announcement msg, as discussed before), but I'll think about some way to add that.

Glad to hear the feedback's been positive, and that it's working so well for you!

Thanks,

Russell
Logged

CowBoyGuy

  • Senior Member
  • ****
  • Offline Offline
  • Posts: 131
    • Al's Cut Rate FBO
Automation of the FSHost
« Reply #8 on: October 23, 2003, 02:57:56 PM »

Here's an idea... if you really want to automate. It's how I managed to create real weather pushes from AWOS data into the FSHost. It takes a bit of work but it'll do the job.

First, get a good look at the source of all the pages you would use (Session start/stop; chat). Collect all the name=value pairs, and create URL's that would access each page and then 'submit' the change. Here's an example from my weather push (the file is rewritten every 15 mins.):

http://10.10.10.10:18010/admin?
http://10.10.10.10:18010/admin?op=show_weather
http://10.10.10.10:18010/admin?op=update_weather&send_weather=checked&re_send_weather=checked&re
_send_seconds=60&altitudes=0&temps=1&pressures=0&cloud_type=0&cloud_cover=-1

That last line is truncated for space ... the weather page is very involved...

Lets say you want to send a message via chat, then shut down in 3 minutes... Create one list of URLs to access the main page, then the chat page, then send a chat message. Create a second set of URLs to access the main page, then the session page, then submit the shutdown command.

Use WGet (if you have a linux box you can use that, otherwise look for something of that type for windows) to initiate the connection with admin ID and password, and call in the listing of URL's. First the message URL, then wait 3 minutes and do it again with the list of URL's for the shutdown.

It took me about 1/2 an hour to get the URL thing working right, and a day and a half to get the weather caclulated... It wouldn't take too long to set up a set of URL's to automate shutdowns. If you run more than one session (like I do) the same process can be run accross any number of sessions or servers from the single Linux host.



« Last Edit: October 23, 2003, 03:33:47 PM by CowBoyGuy »
Logged
Using free stuff to better the world...
http://mywebpages.comcast.net/alandtracysmith/CutRate/
Pages: [1]   Go Up
 

anything