{"action":"closed","issue":{"url":"https://api.github.com/repos/Unitech/pm2/issues/2048","repository_url":"https://api.github.com/repos/Unitech/pm2","labels_url":"https://api.github.com/repos/Unitech/pm2/issues/2048/labels{/name}","comments_url":"https://api.github.com/repos/Unitech/pm2/issues/2048/comments","events_url":"https://api.github.com/repos/Unitech/pm2/issues/2048/events","html_url":"https://github.com/Unitech/pm2/issues/2048","id":144140028,"number":2048,"title":"cluster cannot exit gracefully in no daemon mode","user":{"login":"lenew","id":2917599,"avatar_url":"https://avatars.githubusercontent.com/u/2917599?v=3","gravatar_id":"","url":"https://api.github.com/users/lenew","html_url":"https://github.com/lenew","followers_url":"https://api.github.com/users/lenew/followers","following_url":"https://api.github.com/users/lenew/following{/other_user}","gists_url":"https://api.github.com/users/lenew/gists{/gist_id}","starred_url":"https://api.github.com/users/lenew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lenew/subscriptions","organizations_url":"https://api.github.com/users/lenew/orgs","repos_url":"https://api.github.com/users/lenew/repos","events_url":"https://api.github.com/users/lenew/events{/privacy}","received_events_url":"https://api.github.com/users/lenew/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-29T02:50:45Z","updated_at":"2016-03-29T10:10:11Z","closed_at":"2016-03-29T10:10:11Z","body":"I am trying to deploy pm2 on AWS Elastic BeansTalk using PM2 in **no daemon** mode.\r\nThe bootstrap.js code copy from http://pm2.keymetrics.io/docs/usage/use-pm2-with-cloud-providers/ and change pm2.connect(function() { ... to pm2.connect(**true**, function() {\r\n\r\nI have some problem when running this bootstrap.js\r\nWhen hit Ctrl-C, workers may exit before PM2 to kill it. PM2 will try to restart it. this will cause some error. like \r\n\r\n**my code**\r\n``` console.log(\"=>Staring...\")\r\nvar t1 = setInterval(function(){\r\n\tconsole.log(\"\", new Date())\r\n}, 2000)\r\n\r\nprocess.on(\"SIGINT\", function(){\r\n    console.log(\"=>Exiting...\")\r\n    clearInterval(t1);\r\n    setTimeout(function(){ //simulate some clean work\r\n        console.log(\"=>Fully exit.\")\r\n        process.exit(0);\r\n    },500)\r\n    \r\n});\r\n```\r\n\r\n**some error message**\r\n```\r\n^C2016-03-29 10:43:00: Stopping app:my-app id:0\r\n2016-03-29 10:43:00: [App:my-app] =>Exiting...\r\n\r\n2016-03-29 10:43:00: [App:my-app] =>Exiting...\r\n\r\n2016-03-29 10:43:00: [App:my-app] =>Exiting...\r\n\r\n2016-03-29 10:43:00: Stopping app:my-app id:0\r\n2016-03-29 10:43:00: App name:my-app id:0 disconnected\r\n2016-03-29 10:43:00: Process with pid 73887 still not killed, retrying...\r\n2016-03-29 10:43:00: Process with pid 73887 still not killed, retrying...\r\n2016-03-29 10:43:00: Process with pid 73887 still not killed, retrying...\r\n2016-03-29 10:43:00: Process with pid 73887 still not killed, retrying...\r\n2016-03-29 10:43:00: Process with pid 73887 still not killed, retrying...\r\n2016-03-29 10:43:00: Process with pid 73887 still not killed, retrying...\r\n2016-03-29 10:43:00: Process with pid 73887 still not killed, retrying...\r\n2016-03-29 10:43:00: Process with pid 73887 still not killed, retrying...\r\n2016-03-29 10:43:00: [App:my-app] =>Fully exit.\r\n\r\n2016-03-29 10:43:00: [App:my-app] =>Fully exit.\r\n\r\n2016-03-29 10:43:00: App name:my-app id:2 disconnected\r\n2016-03-29 10:43:00: App [my-app] with id [0] and pid [73887], exited with code [0] via signal [SIGINT]\r\n2016-03-29 10:43:00: App name:my-app id:1 disconnected\r\n2016-03-29 10:43:00: App [my-app] with id [1] and pid [73888], exited with code [0] via signal [SIGINT]\r\n2016-03-29 10:43:00: App [my-app] with id [2] and pid [73897], exited with code [0] via signal [SIGINT]\r\n2016-03-29 10:43:00: Starting execution sequence in -cluster mode- for app name:my-app id:1\r\n2016-03-29 10:43:00: Starting execution sequence in -cluster mode- for app name:my-app id:2\r\n2016-03-29 10:43:01: App name:my-app id:1 online\r\n2016-03-29 10:43:01: App name:my-app id:2 online\r\n**2016-03-29 10:43:01: [App:my-app] =>Staring...**\r\n\r\n2016-03-29 10:43:01: [App:my-app] =>Staring...\r\n\r\n2016-03-29 10:43:01: Stopping app:my-app id:1\r\n2016-03-29 10:43:01: Stopping app:my-app id:1\r\n```\r\nHow to solve this problem?"}}