Grails 2.3.5 - grails stop-app - does not stop the app running via run-app | MyThinkPond

If you’re using Grails 2.3.X and you’re developing, most likely you’re running your app like this:

[sourcecode language=“jscript”] grails run-app #in one command-prompt/shell-terminal and grails stop-app #in another command-prompt/shell-terminal [/sourcecode]

With the latest version of Grails (version 2.3.5), the stop-app say:

[sourcecode language=“jscript”] grails stop-app | Server Stopped

But nothing happens and the server-process continues to run

[/sourcecode]

Here’s an undocumented fix that can come in handy:

[sourcecode language=“jscript”]

On terminal/command-prompt #1

Run the way you do today

grails run-app

On terminal/command-prompt #2, change-directory (cd) to the root folder where you have your Grails project

Create a file with a file-name “.kill-run-app”

For Linux (*Nix) environments

touch .kill-run-app

For Windows where you do not have ‘touch’ command do the following instead

echo hello > .kill-run-app

Wait for a few seconds and Grails will kill the app that’s running

[/sourcecode]

Now you can resume with starting a new instance of “grails run-app”.

Cheers & Happy Coding!

Venkatt Guhesan avatar
About Venkatt Guhesan
Enterprise Software Architect currently working at DataDirect Networks developing a highly scalable monitoring solution called DDN Insight. My passions include all things Open Source including Linux (CentOS, Red Hat, Gentoo, Open Stack, Docker & Ubuntu), embedded ARM processors and microcontrollers (Arduino, UDOO, Cubieboard, BeagleBoard, OnionIO, TI's Zigbee). Coming from an Electrical and Computer Engineering background, working in developing and designing enterprise - distributed, highly scalable software requires a unique set of software skills with a good understanding of the hardware. This makes his work challenging and interesting. In his free time, he spends his time with his family and two children. He also enjoys researching on topics including - world ancient history and yoga. Visit the 'About' section for more details.
comments powered by Disqus