Stop server.sh with another file

Enonic version: xp 6.0.0
OS: Ubuntu Server 14.04.1

How can I stop the server.sh script when started with a demon in system startup? , exist a shutdown.sh?

Regards

I guess there is no shutdown script, but if you know the PID of the java process started by server.sh script you can just use KILL.

If you have a startup script that starts the server as a daemon on ubuntu you should be able to use the same script to stop it.

/Gustaf

1 Like

Hi!
Right after you started server.sh and put it the background, you can get the pid for the running prosess by fetching the variable “$!”. Save this variable as a file and you kan execute a “kill ” top stop the service like this:

./server.sh &
echo $! > xp.pid
kill $(cat xp.pid )

2 Likes