Server not shown as running
Server not shown as running
Operating System: Windows Server 2008 R2 x64
Web server: Microsoft IIS 7.5
Install method: Manual
Database being used: sqlite
I had a dinky homebrew solution before for a test server; a batch script that ran on startup, does some stuff, starts the server, and then checks tasklist for its PID and restarts it if it's not found. I purchased and set up UGCC as a way to allow other users to restart and manage the server.
I modified the script so I could combine its functionality with UGCC, and the easiest and most functional way to do this would be have the batch script do everything (SVN update, startup, etc). So now, the script does everything it did before, except it now also spawns another CMD process that watches the PID of the batch script, and if it was stopped, quits the game server and then exits. I also have the original cmd process echo its own PID into a file, and have that file listed as the PID file.
Essentially, as far as UGCC is concerned, that batch script is the "server" and is what UGCC should be starting/stopping.
The issue I'm having is that after I start the script from the control panel, it's still shown as not running, even though the original cmd.exe process is still running. This prevents other users from being able to stop/restart the server.
Thanks in advance for any advice.
Web server: Microsoft IIS 7.5
Install method: Manual
Database being used: sqlite
I had a dinky homebrew solution before for a test server; a batch script that ran on startup, does some stuff, starts the server, and then checks tasklist for its PID and restarts it if it's not found. I purchased and set up UGCC as a way to allow other users to restart and manage the server.
I modified the script so I could combine its functionality with UGCC, and the easiest and most functional way to do this would be have the batch script do everything (SVN update, startup, etc). So now, the script does everything it did before, except it now also spawns another CMD process that watches the PID of the batch script, and if it was stopped, quits the game server and then exits. I also have the original cmd process echo its own PID into a file, and have that file listed as the PID file.
Essentially, as far as UGCC is concerned, that batch script is the "server" and is what UGCC should be starting/stopping.
The issue I'm having is that after I start the script from the control panel, it's still shown as not running, even though the original cmd.exe process is still running. This prevents other users from being able to stop/restart the server.
Thanks in advance for any advice.
-
- Site Admin
- Posts: 3617
- Joined: Thu Apr 20, 2006 2:54 pm
- Location: America's Heartland
- Contact:
Re: Server not shown as running
Is there any errors/messages in the log tool?
Can you post your executable tab settings?
Can you post your executable tab settings?
Masher
-----------
Please do not PM me unless asked to! We are a small company. If you have an issue or question it would be best to post it in the forums where it can help others in the future.
NEW Join our Discord!
-----------
Please do not PM me unless asked to! We are a small company. If you have an issue or question it would be best to post it in the forums where it can help others in the future.
NEW Join our Discord!
Re: Server not shown as running
Working directory: C:\Users\soupcan\SERVER\sdk2007
Server Executable: C:\Users\soupcan\SERVER\sdk2007\RunGes43.bat
Command Line Arguments: >C:\Users\soupcan\SERVER\sdk2007\Log.txt
Kill Child Processes: Yes (windows doesn't seem to treat the processes started from the script as child processes, so this doesn't seem to make any effect)
PID File: c:\Users\soupcan\SERVER\sdk2007\SvLaunchTemp\43PID.txt
Also, I just realized I left the PID file creation commented out. With it uncommented, it seems to just quit the cmd process very shortly after starting. (The outputted file is the PID with one line break following it, not sure if that's of any relevance, or how to fix it really).
When starting a server, the log only shows what I would expect (given I left the PID file creation commented)
Server id: 2 started by user id soupcan
No pid file found for server 2
When using the PID file, it just shows:
Server id: 2 started by user id soupcan
Server Executable: C:\Users\soupcan\SERVER\sdk2007\RunGes43.bat
Command Line Arguments: >C:\Users\soupcan\SERVER\sdk2007\Log.txt
Kill Child Processes: Yes (windows doesn't seem to treat the processes started from the script as child processes, so this doesn't seem to make any effect)
PID File: c:\Users\soupcan\SERVER\sdk2007\SvLaunchTemp\43PID.txt
Also, I just realized I left the PID file creation commented out. With it uncommented, it seems to just quit the cmd process very shortly after starting. (The outputted file is the PID with one line break following it, not sure if that's of any relevance, or how to fix it really).
When starting a server, the log only shows what I would expect (given I left the PID file creation commented)
Server id: 2 started by user id soupcan
No pid file found for server 2
When using the PID file, it just shows:
Server id: 2 started by user id soupcan
-
- Site Admin
- Posts: 3617
- Joined: Thu Apr 20, 2006 2:54 pm
- Location: America's Heartland
- Contact:
Re: Server not shown as running
I don't think you're going to be able to use the panel in the fashion you'd want.
I think you could do one of two things.
Have the panel launch cmd that in turn runs the batch file. The panel will know the pid since it starts it and there is no need for a pid file. Something like c:\windows\system32\cmd.exe /k "cd c:\myfolder & startbatch.bat" should work.
Your other option is have the panel actually run the game server. Set up all your other stuff as server extras.
Do note that whatever method you choose and depending on the monitoring options you enable (restart on crash, advanced monitoring, update on crash, etc.) anything that restarts the server outside of the panel can be problematic and you may have multiple instances of the server/batch file running so keep and eye on it.
I think you could do one of two things.
Have the panel launch cmd that in turn runs the batch file. The panel will know the pid since it starts it and there is no need for a pid file. Something like c:\windows\system32\cmd.exe /k "cd c:\myfolder & startbatch.bat" should work.
Your other option is have the panel actually run the game server. Set up all your other stuff as server extras.
Do note that whatever method you choose and depending on the monitoring options you enable (restart on crash, advanced monitoring, update on crash, etc.) anything that restarts the server outside of the panel can be problematic and you may have multiple instances of the server/batch file running so keep and eye on it.
Masher
-----------
Please do not PM me unless asked to! We are a small company. If you have an issue or question it would be best to post it in the forums where it can help others in the future.
NEW Join our Discord!
-----------
Please do not PM me unless asked to! We are a small company. If you have an issue or question it would be best to post it in the forums where it can help others in the future.
NEW Join our Discord!
Re: Server not shown as running
Thanks for your help; I've been spending the past few hours figuring everything out.
Everything is almost working perfectly, except I cannot for the life of me get Pageant to load using UGCC. I have a SVN update script run from the server extras menu, that loads Pageant using and it just hangs on that command for all eternity.
Everything is almost working perfectly, except I cannot for the life of me get Pageant to load using UGCC. I have a SVN update script run from the server extras menu, that loads Pageant using
Code: Select all
start pageant.exe "c:\path\to\key.ppk"
-
- Site Admin
- Posts: 3617
- Joined: Thu Apr 20, 2006 2:54 pm
- Location: America's Heartland
- Contact:
Re: Server not shown as running
You shouldn't need start:
Edit: just saw your note that this is in a batch file, so it probably is required. CAn the server process access the key? Is pageant waiting for you to type a passphrase?
Code: Select all
pageant.exe "c:\path\to\key.ppk"
Masher
-----------
Please do not PM me unless asked to! We are a small company. If you have an issue or question it would be best to post it in the forums where it can help others in the future.
NEW Join our Discord!
-----------
Please do not PM me unless asked to! We are a small company. If you have an issue or question it would be best to post it in the forums where it can help others in the future.
NEW Join our Discord!
Re: Server not shown as running
The server can access the key, and the key has no passphrase so Pageant should just start right up and need no interaction. I think I got that bit figured out, but now I have another issue: The script executes, at least partially, and then quits without having actually run the SVN update, with Pageant still running in the background. Everything the process needs, it has access to (pageant, plink, svn, the key, etc)
This is my script as it is currently (on Pastebin) and this is its output. Thanks again for the help.
And this isn't directly related, but it would be nice if you could have an option for the server to be stopped when running extras (and restarted when it's done). It would make things like this easier.
This is my script as it is currently (on Pastebin) and this is its output. Thanks again for the help.
And this isn't directly related, but it would be nice if you could have an option for the server to be stopped when running extras (and restarted when it's done). It would make things like this easier.
-
- Site Admin
- Posts: 3617
- Joined: Thu Apr 20, 2006 2:54 pm
- Location: America's Heartland
- Contact:
Re: Server not shown as running
Maybe svn isn't in your path, try including the full path to the svn executable in your batch file.
Masher
-----------
Please do not PM me unless asked to! We are a small company. If you have an issue or question it would be best to post it in the forums where it can help others in the future.
NEW Join our Discord!
-----------
Please do not PM me unless asked to! We are a small company. If you have an issue or question it would be best to post it in the forums where it can help others in the future.
NEW Join our Discord!
Re: Server not shown as running
Edit: I made some really ditzy mistakes, which I corrected.
I'll test some more and then post back.
I'll test some more and then post back.
Last edited by soupcan on Wed Sep 09, 2015 5:46 pm, edited 1 time in total.
-
- Site Admin
- Posts: 3617
- Joined: Thu Apr 20, 2006 2:54 pm
- Location: America's Heartland
- Contact:
Re: Server not shown as running
Try quoting the path of the svn command
Masher
-----------
Please do not PM me unless asked to! We are a small company. If you have an issue or question it would be best to post it in the forums where it can help others in the future.
NEW Join our Discord!
-----------
Please do not PM me unless asked to! We are a small company. If you have an issue or question it would be best to post it in the forums where it can help others in the future.
NEW Join our Discord!
Re: Server not shown as running
Here's the new script: http://pastebin.com/iPV1g1sr and output: http://pastebin.com/sLYBPz5j
While the output might look clean, for some reason it's still not running svn.
While the output might look clean, for some reason it's still not running svn.
-
- Site Admin
- Posts: 3617
- Joined: Thu Apr 20, 2006 2:54 pm
- Location: America's Heartland
- Contact:
Re: Server not shown as running
svn cleanup %GAMEDIR% (is this important? should have full path)
"C:\Program Files\SlikSvn\bin\svn.exe" --non-interactive up"svn revert "%GAMEDIR%" -R -q (intended to be two lines maybe?)
"C:\Program Files\SlikSvn\bin\svn.exe" --non-interactive up"svn revert "%GAMEDIR%" -R -q (intended to be two lines maybe?)
Masher
-----------
Please do not PM me unless asked to! We are a small company. If you have an issue or question it would be best to post it in the forums where it can help others in the future.
NEW Join our Discord!
-----------
Please do not PM me unless asked to! We are a small company. If you have an issue or question it would be best to post it in the forums where it can help others in the future.
NEW Join our Discord!
Re: Server not shown as running
Yeah, another oversight of mine. Most of that doesn't belong there at all.
Anyway, I'm going to approach this a bit differently. If it doesn't work, not a huge deal; I've still got several other uses for this panel. Thanks for the help.
Anyway, I'm going to approach this a bit differently. If it doesn't work, not a huge deal; I've still got several other uses for this panel. Thanks for the help.
Re: Server not shown as running
Well, I tested running things directly and they seem to work fine. I remembered that I switched to ping instead of timeout because input redirection doesn't work when run through ugcc. I think that's my problem here; svn won't run since it presumably requires input redirection (for Y/N prompts, etc).