{"action":"closed","issue":{"url":"https://api.github.com/repos/fgnass/node-dev/issues/104","labels_url":"https://api.github.com/repos/fgnass/node-dev/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/fgnass/node-dev/issues/104/comments","events_url":"https://api.github.com/repos/fgnass/node-dev/issues/104/events","html_url":"https://github.com/fgnass/node-dev/issues/104","id":104639932,"number":104,"title":"What does child.respawn mean?","user":{"login":"jiyinyiyong","id":449224,"avatar_url":"https://avatars.githubusercontent.com/u/449224?v=3","gravatar_id":"","url":"https://api.github.com/users/jiyinyiyong","html_url":"https://github.com/jiyinyiyong","followers_url":"https://api.github.com/users/jiyinyiyong/followers","following_url":"https://api.github.com/users/jiyinyiyong/following{/other_user}","gists_url":"https://api.github.com/users/jiyinyiyong/gists{/gist_id}","starred_url":"https://api.github.com/users/jiyinyiyong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiyinyiyong/subscriptions","organizations_url":"https://api.github.com/users/jiyinyiyong/orgs","repos_url":"https://api.github.com/users/jiyinyiyong/repos","events_url":"https://api.github.com/users/jiyinyiyong/events{/privacy}","received_events_url":"https://api.github.com/users/jiyinyiyong/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-03T07:45:29Z","updated_at":"2016-01-29T13:26:17Z","closed_at":"2016-01-29T13:26:17Z","body":"I remmemberd `node-dev a.js` will always runs until I press Command-C to kill it. But for quite long time it's not. It stops as long as the program exits, and keeps running when there's an event loop or something. So I looked into the code today and found `child.respawn` to be `undefined`.\r\n\r\n```js\r\n  function start() {\r\n    var cmd = nodeArgs.concat(wrapper, script, scriptArgs)\r\n    child = fork(cmd[0], cmd.slice(1), {\r\n      cwd: process.cwd(),\r\n      env: process.env\r\n    })\r\n    .on('exit', function(code) {\r\n      console.log(child, child.respawn) // <-- undefined\r\n      if (!child.respawn) process.exit(code)\r\n      child = undefined\r\n    })\r\n```\r\n```js\r\n  function stop() {\r\n    child.respawn = true\r\n    child.kill('SIGTERM')\r\n    child.disconnect()\r\n  }\r\n```\r\n```\r\n➤➤ uname -a\r\nDarwin Air.local 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 16 23:12:31 PDT 2015; root:xnu-2782.20.48~4/RELEASE_X86_64 x86_64\r\n➤➤ node -v\r\nv0.12.5\r\n```\r\n\r\nAny ideas on why it's happing? Or is it designed to behave like that?"}}