{"action":"created","issue":{"url":"https://api.github.com/repos/Unitech/PM2/issues/1283","labels_url":"https://api.github.com/repos/Unitech/PM2/issues/1283/labels{/name}","comments_url":"https://api.github.com/repos/Unitech/PM2/issues/1283/comments","events_url":"https://api.github.com/repos/Unitech/PM2/issues/1283/events","html_url":"https://github.com/Unitech/PM2/issues/1283","id":77633883,"number":1283,"title":"pm2 restart overwrites env variables with global env variables","user":{"login":"aronwoost","id":408962,"avatar_url":"https://avatars.githubusercontent.com/u/408962?v=3","gravatar_id":"","url":"https://api.github.com/users/aronwoost","html_url":"https://github.com/aronwoost","followers_url":"https://api.github.com/users/aronwoost/followers","following_url":"https://api.github.com/users/aronwoost/following{/other_user}","gists_url":"https://api.github.com/users/aronwoost/gists{/gist_id}","starred_url":"https://api.github.com/users/aronwoost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aronwoost/subscriptions","organizations_url":"https://api.github.com/users/aronwoost/orgs","repos_url":"https://api.github.com/users/aronwoost/repos","events_url":"https://api.github.com/users/aronwoost/events{/privacy}","received_events_url":"https://api.github.com/users/aronwoost/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-05-18T12:15:58Z","updated_at":"2015-06-15T08:17:18Z","closed_at":null,"body":"My app json:\r\n```\r\n{\r\n  \"name\": \"app\",\r\n  \"script\": \"index.js\",\r\n  \"instances\": 1,\r\n  \"exec_mode\": \"cluster_mode\",\r\n  \"env\": {\r\n    \"MY_SETTING\": \"some_path\"\r\n  }\r\n}\r\n```\r\nIf global environment variable `MY_SETTING` is set to `\"some_other_path\"` the app uses the global one (`\"some_other_path\"`) after `pm2 restart app`.\r\n\r\nInteresting fact: when max_memory_restart caused the restart, pm2 uses the \"local\" env variable (`\"some_path\"`)."},"comment":{"url":"https://api.github.com/repos/Unitech/PM2/issues/comments/111974420","html_url":"https://github.com/Unitech/PM2/issues/1283#issuecomment-111974420","issue_url":"https://api.github.com/repos/Unitech/PM2/issues/1283","id":111974420,"user":{"login":"ThomasBormans","id":4234096,"avatar_url":"https://avatars.githubusercontent.com/u/4234096?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasBormans","html_url":"https://github.com/ThomasBormans","followers_url":"https://api.github.com/users/ThomasBormans/followers","following_url":"https://api.github.com/users/ThomasBormans/following{/other_user}","gists_url":"https://api.github.com/users/ThomasBormans/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasBormans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasBormans/subscriptions","organizations_url":"https://api.github.com/users/ThomasBormans/orgs","repos_url":"https://api.github.com/users/ThomasBormans/repos","events_url":"https://api.github.com/users/ThomasBormans/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasBormans/received_events","type":"User","site_admin":false},"created_at":"2015-06-15T08:17:18Z","updated_at":"2015-06-15T08:17:18Z","body":"+1"}}