Jump to content
The Uniform Server Community
bdic

PC Win Start-up

Recommended Posts

I am new to uniform server, it is a great product.  I have installed uniform serverZ - XIV and everything is working well.  I am using it in production mode and have no issues.  My concern, however, is that I have selected under the extra tab, PC-Win Stat-up.  I have  selected items to run at startup up both apache and mysql as well as run at start-up.  However, when pc starts up the server starts as verified in the task manager startup window, but I have to manually start the user interface and both apache and mysql are off and must be manually started.  They start with no problem. 

My issue is that when windows does an update and restarts the computer, I have to manual start these items.  This is even worse if I happen not to be around at the time.  I have checked the us_config.ini and the configuration is correct.

______________________________________________________________________________

[PCSTARTUP]
;
;--PC initial start-up.
; RunAtPcStartUpEnabled    Enables auto run at PC start up:  true/false
; RunApacheAtStartUp=true  Run Apache server at PC start-up: true/false
; RunMysqlAtStartUp=true   Run MySQL server at PC start-up: true/false
;
RunAtPcStartUpEnabled=true
RunApacheAtStartUp=true
RunMysqlAtStartUp=true

______________________________________________________________________________

 

Share this post


Link to post
Share on other sites

You can do it with batch files. Just change the drives and folders to suit your setup.
 

Place something like this in your startup folder for Windows 10 just hit the windows key + R and
type SHELL:STARTUP and it will run when you start up the computer.

You can also place it on your desktop

---------------- BEGIN SCRIPTS -------------------

CLS
echo off
rem elevate to run the script
if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b)
 

:START_UNICONTROLLER
rem add a small timeout
TIMEOUT /T 1 >nul 
rem start up both servers - UniController and MySQL
C:\Windows\System32\cmd.exe /c c:\UniServerZ\UniController.exe start_both 
exit
 

 

To shutdown the servers
c:\Windows\System32\cmd.exe /c tasklist /fi "IMAGENAME eq httpd_z.exe" 2>NUL | find /I /N "httpd_z.exe">NUL
  if "%ERRORLEVEL%"=="0" ( 
    c:\Windows\System32\cmd.exe /c c:\UniServerZ\UniController.exe stop_both )
  ) else ( 
  if "%ERRORLEVEL%"=="0" ( rem MySqld_z.exe is not running )
goto another_task
)

To shutdown the controller

:KILL_UNICONTROLLER
c:\Windows\System32\cmd.exe /c tasklist /fi "IMAGENAME eq UniController.exe" 2>NUL | find /I /N "UniController.exe">NUL
  if "%ERRORLEVEL%"=="0" ( 
    c:\Windows\System32\cmd.exe /c taskkill /F /IM UniController.exe 
  ) 

 

Share this post


Link to post
Share on other sites

Thanks  very much for getting back to me.  Works great.

In order to have the control panel open I added add a line to open the control panel after the start commands so the when the control panel opens both servers are already on and green.  Will not work if added before the start commands.  Again thanks.

CLS
echo off
rem elevate to run the script
if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b)
 

:START_UNICONTROLLER
rem add a small timeout
TIMEOUT /T 1 >nul 
rem start up both servers - UniController and MySQL
C:\Windows\System32\cmd.exe /c c:\UniServerZ\UniController.exe start_both
C:\Windows\System32\cmd.exe /c c:\UniServerZ\UniController.exe
exit

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...