{"action":"created","issue":{"url":"https://api.github.com/repos/Unitech/pm2/issues/1888","labels_url":"https://api.github.com/repos/Unitech/pm2/issues/1888/labels{/name}","comments_url":"https://api.github.com/repos/Unitech/pm2/issues/1888/comments","events_url":"https://api.github.com/repos/Unitech/pm2/issues/1888/events","html_url":"https://github.com/Unitech/pm2/issues/1888","id":126550633,"number":1888,"title":"Wrong user home set when generating pm2-init.sh","user":{"login":"binarykitchen","id":177641,"avatar_url":"https://avatars.githubusercontent.com/u/177641?v=3","gravatar_id":"","url":"https://api.github.com/users/binarykitchen","html_url":"https://github.com/binarykitchen","followers_url":"https://api.github.com/users/binarykitchen/followers","following_url":"https://api.github.com/users/binarykitchen/following{/other_user}","gists_url":"https://api.github.com/users/binarykitchen/gists{/gist_id}","starred_url":"https://api.github.com/users/binarykitchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binarykitchen/subscriptions","organizations_url":"https://api.github.com/users/binarykitchen/orgs","repos_url":"https://api.github.com/users/binarykitchen/repos","events_url":"https://api.github.com/users/binarykitchen/events{/privacy}","received_events_url":"https://api.github.com/users/binarykitchen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"soyuka","id":1321971,"avatar_url":"https://avatars.githubusercontent.com/u/1321971?v=3","gravatar_id":"","url":"https://api.github.com/users/soyuka","html_url":"https://github.com/soyuka","followers_url":"https://api.github.com/users/soyuka/followers","following_url":"https://api.github.com/users/soyuka/following{/other_user}","gists_url":"https://api.github.com/users/soyuka/gists{/gist_id}","starred_url":"https://api.github.com/users/soyuka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soyuka/subscriptions","organizations_url":"https://api.github.com/users/soyuka/orgs","repos_url":"https://api.github.com/users/soyuka/repos","events_url":"https://api.github.com/users/soyuka/events{/privacy}","received_events_url":"https://api.github.com/users/soyuka/received_events","type":"User","site_admin":false},"milestone":null,"comments":7,"created_at":"2016-01-14T00:45:03Z","updated_at":"2016-01-15T15:16:39Z","closed_at":null,"body":"Just followed the instructions in http://pm2.keymetrics.io/docs/usage/startup/#user-permissions and ran this command `$ pm2 startup ubuntu -u node`\r\n\r\nThen had a look at `/etc/init.d/pm2-init.sh` here are the first top lines of that fine:\r\n\r\n```\r\nNAME=pm2\r\nPM2=/usr/lib/node_modules/pm2/bin/pm2\r\nUSER=nodejs\r\nDEFAULT=/etc/default/$NAME\r\n\r\nexport PATH=/usr/bin:$PATH\r\nexport PM2_HOME=\"/home/michael.heuberger/.pm2\"\r\n```\r\n`USER` is correct. But `PM2_HOME` is wrong. Should be `/home/nodejs/.pm2`"},"comment":{"url":"https://api.github.com/repos/Unitech/pm2/issues/comments/171988475","html_url":"https://github.com/Unitech/pm2/issues/1888#issuecomment-171988475","issue_url":"https://api.github.com/repos/Unitech/pm2/issues/1888","id":171988475,"user":{"login":"soyuka","id":1321971,"avatar_url":"https://avatars.githubusercontent.com/u/1321971?v=3","gravatar_id":"","url":"https://api.github.com/users/soyuka","html_url":"https://github.com/soyuka","followers_url":"https://api.github.com/users/soyuka/followers","following_url":"https://api.github.com/users/soyuka/following{/other_user}","gists_url":"https://api.github.com/users/soyuka/gists{/gist_id}","starred_url":"https://api.github.com/users/soyuka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soyuka/subscriptions","organizations_url":"https://api.github.com/users/soyuka/orgs","repos_url":"https://api.github.com/users/soyuka/repos","events_url":"https://api.github.com/users/soyuka/events{/privacy}","received_events_url":"https://api.github.com/users/soyuka/received_events","type":"User","site_admin":false},"created_at":"2016-01-15T15:16:39Z","updated_at":"2016-01-15T15:16:39Z","body":"@binarykitchen :\r\n>  Just wondering why is the -u user not the same as the user who handled pm2 (when you did pm2 startup -u). They should have the same home.\r\n\r\nCould you give me a use case where they are different? \r\n\r\nI want to remove the `-u` option to avoid such issues but this would mean that the user that issues `pm2 startup` will have to be the same as the one that will launch pm2 on startup."}}