cancel
Showing results for 
Search instead for 
Did you mean: 

how to stop hybris server by using windows batch(script for windows) command?

Former Member
0 Kudos
 
Former Member
0 Kudos

If you have installed hybrisserver as a windows service, you can use the following command to stop it:

 hybrisserver stop

You need to include this command in your batch script.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello

If you are not running it as a service, ctrl+c is fine for stopping the server. But for some reason if you absolutely must kill it through a script without having it as a service, I wrote this, may be it'll help. Save it as a .bat file in your platform folder. Run whenever you want to kill the server. (It's a force kill)

 @echo off 

 set /p wrapper_pid=<../../data/hybristomcat.lock
 set /p java_pid=<../../data/hybristomcat.java.pid


 IF %wrapper_pid% == [] ( goto :wrapper_error )

 IF %java_pid% == [] ( goto :java_error )

 goto :kill


 :wrapper_error
 ECHO Tanuki wrapper not running... exiting.
 EXIT /b

 :java_error
 ECHO Java process not running... exiting.
 EXIT /b

 :kill
 ECHO Tanuki wrapper PID: %wrapper_pid% 
 ECHO Java Process PID: %java_pid% 
 ECHO Stopping Hybris Server...
 taskkill /f /pid %wrapper_pid% /pid %java_pid%
Former Member
0 Kudos

This is what i was looking for .

Thanks Navneet