{"action":"created","issue":{"url":"https://api.github.com/repos/Unitech/pm2/issues/1627","repository_url":"https://api.github.com/repos/Unitech/pm2","labels_url":"https://api.github.com/repos/Unitech/pm2/issues/1627/labels{/name}","comments_url":"https://api.github.com/repos/Unitech/pm2/issues/1627/comments","events_url":"https://api.github.com/repos/Unitech/pm2/issues/1627/events","html_url":"https://github.com/Unitech/pm2/issues/1627","id":107463946,"number":1627,"title":"BUG: Restarting does not seem to respect declaration file","user":{"login":"creynders","id":436347,"avatar_url":"https://avatars.githubusercontent.com/u/436347?v=3","gravatar_id":"","url":"https://api.github.com/users/creynders","html_url":"https://github.com/creynders","followers_url":"https://api.github.com/users/creynders/followers","following_url":"https://api.github.com/users/creynders/following{/other_user}","gists_url":"https://api.github.com/users/creynders/gists{/gist_id}","starred_url":"https://api.github.com/users/creynders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/creynders/subscriptions","organizations_url":"https://api.github.com/users/creynders/orgs","repos_url":"https://api.github.com/users/creynders/repos","events_url":"https://api.github.com/users/creynders/events{/privacy}","received_events_url":"https://api.github.com/users/creynders/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2015-09-21T08:20:56Z","updated_at":"2016-07-01T06:24:38Z","closed_at":null,"body":"Some context: I have a single user `dpac` which runs two separate instances of the same code. They're fully separated, i.e. I have a directory `tool` and a directory `demo`, each with the same code (they're not always fully synced, which is why I'm using two different directories)\r\nI have these declaration files:\r\n\r\n```js\r\n//file: process.staging.json\r\n{\r\n  \"apps\": [\r\n    {\r\n      \"name\": \"staging\",\r\n      \"script\": \"app/server.js\",\r\n      \"env\": {\r\n        \"NODE_ENV\": \"staging\"\r\n      }\r\n    }\r\n  ]\r\n}\r\n```\r\n```js\r\n//file: process.demo.json\r\n{\r\n  \"apps\": [\r\n    {\r\n      \"name\": \"demo\",\r\n      \"script\": \"app/server.js\",\r\n      \"env\": {\r\n        \"NODE_ENV\": \"demo\"\r\n      }\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\nThe default `NODE_ENV` is \"staging\".\r\n\r\nStarting the applications works perfectly. And `pm2 restart staging` too.\r\nBut if I do `pm2 restart demo`, suddenly the application declaration file is disregarded (or at least part of it) since it uses \"staging\" as a `NODE_ENV` instead of \"demo\" as declared.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Unitech/pm2/issues/comments/229863881","html_url":"https://github.com/Unitech/pm2/issues/1627#issuecomment-229863881","issue_url":"https://api.github.com/repos/Unitech/pm2/issues/1627","id":229863881,"user":{"login":"birdbyrd","id":19778412,"avatar_url":"https://avatars.githubusercontent.com/u/19778412?v=3","gravatar_id":"","url":"https://api.github.com/users/birdbyrd","html_url":"https://github.com/birdbyrd","followers_url":"https://api.github.com/users/birdbyrd/followers","following_url":"https://api.github.com/users/birdbyrd/following{/other_user}","gists_url":"https://api.github.com/users/birdbyrd/gists{/gist_id}","starred_url":"https://api.github.com/users/birdbyrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/birdbyrd/subscriptions","organizations_url":"https://api.github.com/users/birdbyrd/orgs","repos_url":"https://api.github.com/users/birdbyrd/repos","events_url":"https://api.github.com/users/birdbyrd/events{/privacy}","received_events_url":"https://api.github.com/users/birdbyrd/received_events","type":"User","site_admin":false},"created_at":"2016-07-01T06:24:38Z","updated_at":"2016-07-01T06:24:38Z","body":"I have the same issue. pm2: 1.1.3, nvm: 2.7.4, node: 0.12.2\r\n\r\n@creynders workaround: you can perform `pm2 restart process.demo.json` This works for me."}}
{"actor":{"display_login":"birdbyrd"}}