generator-angular-fullstack icon indicating copy to clipboard operation
generator-angular-fullstack copied to clipboard

grunt serve won't exit

Open lstroud opened this issue 12 years ago • 19 comments

'grunt serve' won't accept a ctrl-c. I just created a new project to test and I get the same behavior. Also, when I kill the process, it takes the shell with it.

lstroud avatar Jan 15 '14 00:01 lstroud

Update: This 'hung' state only occurs after an express reload. Here is the output:

>> File "lib/controllers/api.js" changed.
Running "newer:jshint:server" (newer) task
Running "jshint:server" (jshint) task
✔ No problems
Running "newer-timestamp:jshint:server:/Users/les/Documents/development/code/clients/barnhardt/beip/trunk/app/ea/node_modules/grunt-newer/.cache" (newer-timestamp) task
Running "newer-reconfigure:jshint:server:1" (newer-reconfigure) task
Running "express:dev" (express) task
Stopping Express server
Starting background Express server
Running "watch" task
... Reload lib/controllers/api.js ...
Completed in 0.103s at Tue Jan 14 2014 19:23:56 GMT-0500 (EST) - Waiting...
debugger listening on port 5858
connect.multipart() will be removed in connect 3.0
visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
connect.limit() will be removed in connect 3.0
Express server listening on port 9000 in development mode
GET / 304 5ms
GET /partials/main 304 2ms
GET /api/awesomeThings 304 1ms
GET /partials/navbar 304 1ms

lstroud avatar Jan 15 '14 00:01 lstroud

That all looks normal. Are you saying that it actually hangs up the command prompt or just that you can't type in it?

DaftMonk avatar Jan 15 '14 00:01 DaftMonk

I had the similar problem. The shell states that the grunt had been stopped, but running ps shows the grunt process still hard at work. Had to kill - 9 the grunt pid. However it was actually because I was using ctrl-z, not ctrl-c. My bad. Just updated angular-fullstack, built it, and it works fine. Ctrl-c is ending grunt serve. On 15/01/2014 10:12 AM, "Les Stroud" [email protected] wrote:

'grunt serve' won't accept a ctrl-c. I just created a new project to test and I get the same behavior. Also, when I kill the process, it takes the shell with it.

Maybe I am missing something, but is there some other way to exit from 'grunt serve'?

— Reply to this email directly or view it on GitHubhttps://github.com/DaftMonk/generator-angular-fullstack/issues/52 .

rovens avatar Jan 15 '14 00:01 rovens

Ok, I haven't used Ctrl+C for ending the process before, I just typically leave the grunt serve task running on a separate command prompt. But now I see what you mean, and it happened to me as well.

DaftMonk avatar Jan 15 '14 00:01 DaftMonk

It's interesting that it's only triggered by the restart of the server. I've been thinking about switching the grunt-express-server to nodemon for other reasons, but if nodemon solves this as well, thats all the more reason.

Edit: nodemon doesn't have this problem with server reloads, but it's going to be hard to configure it the same way we have grunt-express-server setup..

DaftMonk avatar Jan 15 '14 01:01 DaftMonk

@DaftMonk that's the problem I'm facing too, maybe it wasn't related to issue #42, sorry for the confusion on my part here.

kjellski avatar Jan 15 '14 08:01 kjellski

If going nodemon breaks other functionality, maybe we could configure grunt to listen for SIGINT differently and have it issue the appropriate kills?

lstroud avatar Jan 15 '14 21:01 lstroud

@lstroud Perhaps, but it looks like the creator of grunt-express-server is having a look at the problem and might be able to do something to fix it.

The issue seems to be that after the grunt-express-server stops, it removes all the listeners on the process, which also removes the listener for the abort command. Hopefully we can fix the problem right there.

DaftMonk avatar Jan 15 '14 23:01 DaftMonk

I'm having this issue as well, glad to see it's already being addressed :)

theothermattm avatar Feb 01 '14 15:02 theothermattm

I'm having this issue as well, glad to see it's already being addressed :)

supercrabtree avatar Feb 05 '14 23:02 supercrabtree

+1 Great generator, but not being able to ctrl+c the serve process is quite the nuisance

andymcfee avatar Feb 06 '14 09:02 andymcfee

+1 i also would like the idea of having nodemon running everything express related and grunt only for angular stuff, but I understand that's difficult to get set up. will try to dig into this myself.

tmaximini avatar Feb 07 '14 14:02 tmaximini

+1

Toub avatar Feb 07 '14 18:02 Toub

I have an outstanding PR for grunt-express-server that resolves this, just waiting for ericclemmons to get the chance to review it.

DaftMonk avatar Feb 07 '14 19:02 DaftMonk

+1 agree !

jackypan1989 avatar Feb 10 '14 08:02 jackypan1989

When this symptom occurs does grunt also stop serving requests for you? When changing files I'm getting the symptom of the grunt process not being able to be terminated like here but it also will not serve any requests until I kill the proc and restart it.

joshperry avatar Feb 16 '14 20:02 joshperry

Closed via https://github.com/ericclemmons/grunt-express-server/pull/39

DaftMonk avatar Feb 16 '14 21:02 DaftMonk

Figured out my freezing issue. Had nothing to do with this, good to have this fixed though.

joshperry avatar Feb 16 '14 22:02 joshperry

Thx guys, it can be fixed by updating to the latest version of grunt-express-server

jackypan1989 avatar Feb 21 '14 01:02 jackypan1989