How to kill Rackup process in background?

785 Views Asked by At

I managed to host the RedMine using the Rackup and Puma by running the following code in the CMD.

rackup -I "script/rails" -s "puma" -O "-q" -E "production"

But this will keep the CMD still up and running. Thus, I created a windows service to run a .BAT file that will execute this command. It worked and the RedMine is now hosted in the background

And now my problems appears. I am now unable to stop the RedMine. Even if I stopped the service that run the .BAT file, the RedMine is still hosted. This is because I do not know how to kill the rackup process in the OnStop() function of the windows service.

Only way I could kill it is by killing the ruby.exe process. Hope you all could guide me to do this in a better way. Thanks

0

There are 0 best solutions below