{"action":"closed","issue":{"url":"https://api.github.com/repos/Unitech/PM2/issues/1522","labels_url":"https://api.github.com/repos/Unitech/PM2/issues/1522/labels{/name}","comments_url":"https://api.github.com/repos/Unitech/PM2/issues/1522/comments","events_url":"https://api.github.com/repos/Unitech/PM2/issues/1522/events","html_url":"https://github.com/Unitech/PM2/issues/1522","id":100675184,"number":1522,"title":"pm2 stop and SIGKILL  signal","user":{"login":"wf744","id":3078907,"avatar_url":"https://avatars.githubusercontent.com/u/3078907?v=3","gravatar_id":"","url":"https://api.github.com/users/wf744","html_url":"https://github.com/wf744","followers_url":"https://api.github.com/users/wf744/followers","following_url":"https://api.github.com/users/wf744/following{/other_user}","gists_url":"https://api.github.com/users/wf744/gists{/gist_id}","starred_url":"https://api.github.com/users/wf744/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wf744/subscriptions","organizations_url":"https://api.github.com/users/wf744/orgs","repos_url":"https://api.github.com/users/wf744/repos","events_url":"https://api.github.com/users/wf744/events{/privacy}","received_events_url":"https://api.github.com/users/wf744/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-13T02:07:51Z","updated_at":"2015-08-13T13:04:21Z","closed_at":"2015-08-13T13:04:21Z","body":"I use pm2(0.14.6, CentOS6.5 64bit, node v0.10.36) to manager game servers, my app listen to the \"SIGTERM\" signal, when i use \"pm2 stop all\" to stop my apps, pm2 send the \"SIGTERM\" signal to my app, then my app save all the online game player data to database and do some other clear up things，it take about 5 minutes,but pm2 send the SIGKILL signal to my app after 1.6s,and my app was killed, all the unsaved player data lost...\r\n\r\nI try to listen the \"SIGKILL\" signal, but fail, node not allow to listen this signal.\r\n\r\nSo how to solve this problem ?\r\n\r\n\r\npm2 log:\r\n```\r\nPM2: 2015-08-13 05:40:54: Process with pid 26210 still not killed, retrying...\r\nPM2: 2015-08-13 05:40:54: Process with pid 26210 still not killed, retrying...\r\nPM2: 2015-08-13 05:40:54: Process with pid 26210 still not killed, retrying...\r\nPM2: 2015-08-13 05:40:54: Process with pid 26210 still not killed, retrying...\r\nPM2: 2015-08-13 05:40:55: Process with pid 26210 still not killed, retrying...\r\nPM2: 2015-08-13 05:40:55: Process with pid 26210 still not killed, retrying...\r\nPM2: 2015-08-13 05:40:55: Process with pid 26210 still not killed, retrying...\r\nPM2: 2015-08-13 05:40:55: Process with pid 26210 still not killed, retrying...\r\nPM2: 2015-08-13 05:40:55: Process with pid 26210 still not killed, retrying...\r\nPM2: 2015-08-13 05:40:55: Process with pid 26210 still not killed, retrying...\r\nPM2: 2015-08-13 05:40:55: Process with pid 26210 still not killed, retrying...\r\nPM2: 2015-08-13 05:40:55: Process with pid 26210 still not killed, retrying...\r\nPM2: 2015-08-13 05:40:55: Process with pid 26210 still not killed, retrying...\r\nPM2: 2015-08-13 05:40:55: Process with pid 26210 still alive after 1600ms, sending it SIGKILL now...\r\nPM2: 2015-08-13 05:40:55: App name:11_control id:1 exited with code SIGKILL\r\nPM2: 2015-08-13 05:40:56: Process with pid 26210 killed\r\nPM2: 2015-08-13 06:30:55: Starting execution sequence in -fork mode- for app name:2_control id:0\r\nPM2: 2015-08-13 06:30:55: App name:2_control id:0 online\r\nPM2: 2015-08-13 06:30:55: Starting execution sequence in -fork mode- for app name:11_control id:1\r\nPM2: 2015-08-13 06:30:55: App name:11_control id:1 online\r\n```\r\n\r\n\r\n\r\nPS.I know i can use \"pm2 sendSignal SIGUSR2 my-app\" to send a \"SIGTERM\" signal to my app, my app will work fine, saving all the online player data and then exit, but after exit, pm2 restart my app automatically what is not i expect(what i need is app save all the data to db and then stop, so i can do other upgrade things and backup pm2 logs ). but at the same time, i also need the auto restart mechanism, when my app throw a uncaught exception, i need to save the data and then auto restart my app.\r\n\r\nthanks!\r\n"}}