{"action":"created","issue":{"url":"https://api.github.com/repos/Unitech/pm2/issues/3196","repository_url":"https://api.github.com/repos/Unitech/pm2","labels_url":"https://api.github.com/repos/Unitech/pm2/issues/3196/labels{/name}","comments_url":"https://api.github.com/repos/Unitech/pm2/issues/3196/comments","events_url":"https://api.github.com/repos/Unitech/pm2/issues/3196/events","html_url":"https://github.com/Unitech/pm2/issues/3196","id":263163888,"number":3196,"title":"cwd doesn't appear to be doing anything","user":{"login":"DataTables","id":278219,"avatar_url":"https://avatars3.githubusercontent.com/u/278219?v=4","gravatar_id":"","url":"https://api.github.com/users/DataTables","html_url":"https://github.com/DataTables","followers_url":"https://api.github.com/users/DataTables/followers","following_url":"https://api.github.com/users/DataTables/following{/other_user}","gists_url":"https://api.github.com/users/DataTables/gists{/gist_id}","starred_url":"https://api.github.com/users/DataTables/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataTables/subscriptions","organizations_url":"https://api.github.com/users/DataTables/orgs","repos_url":"https://api.github.com/users/DataTables/repos","events_url":"https://api.github.com/users/DataTables/events{/privacy}","received_events_url":"https://api.github.com/users/DataTables/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-10-05T15:15:11Z","updated_at":"2017-10-06T08:24:35Z","closed_at":null,"author_association":"NONE","body":"## What's going wrong?\r\n\r\nThe `cwd` option for the configuration files doesn't appear to be working.\r\n\r\n## How could we reproduce this issue?\r\n\r\nHonestly, I'm not sure - I see that the repo has tests in it to check for the cwd, so perhaps I'm doing something wrong, but I can't see what and I've read everything I can find on the topic.\r\n\r\nI use a configuration file such as:\r\n\r\n```\r\n\t\t{\r\n\t\t\t\"name\": \"core\",\r\n\t\t\t\"cwd\": \"/project/core/dist\",\r\n\t\t\t\"script\": \"./index.js\",\r\n\t\t\t\"watch\": true,\r\n\t\t\t\"env\": {\r\n\t\t\t\t\"NODE_ENV\": \"development\"\r\n\t\t\t},\r\n\t\t\t\"env_production\": {\r\n\t\t\t\t\"NODE_ENV\": \"production\"\r\n\t\t\t}\r\n\t\t}\r\n```\r\n\r\nI would expect the result to basically be the same as `cd /project/core/dist; node ./index.js`, but for some reason I can't explain the working directory is actually being set to `/project`.\r\n\r\nI use `pm2 list` to get the list of processes and then `pwdx` to determine the working directory of the executing program from its pid:\r\n\r\n```\r\n$ pwdx 10934\r\n/project\r\n```\r\n\r\nIs there any logging or something that I can enable to see where pm2 is executing the cwd?\r\n\r\n## Supporting information\r\n\r\nPlease run the following command (available on PM2 >= 2.6)\r\n\r\n```\r\n===============================================================================\r\n--- PM2 REPORT (Thu Oct 05 2017 15:09:02 GMT+0000 (UTC)) ----------------------\r\n===============================================================================\r\n--- Daemon -------------------------------------------------\r\npm2d version         : 2.7.1\r\nnode version         : 7.10.1\r\nnode path            : undefined\r\nargv                 : /usr/bin/node,/usr/lib/node_modules/pm2/lib/Daemon.js\r\nargv0                : node\r\nuser                 : vagrant\r\nuid                  : 1000\r\ngid                  : 1000\r\nuptime               : 38min\r\n===============================================================================\r\n--- CLI ----------------------------------------------------\r\nlocal pm2            : 2.7.1\r\nnode version         : 7.10.1\r\nnode path            : /usr/bin/pm2\r\nargv                 : /usr/bin/node,/usr/bin/pm2,report\r\nargv0                : node\r\nuser                 : vagrant\r\nuid                  : 1000\r\ngid                  : 1000\r\n===============================================================================\r\n--- System info --------------------------------------------\r\narch                 : x64\r\nplatform             : linux\r\ntype                 : Linux\r\ncpus                 : Intel Core Processor (Skylake)\r\ncpus nb              : 1\r\nfreemem              : 55660544\r\ntotalmem             : 512323584\r\nhome                 : /home/vagrant\r\n===============================================================================\r\n--- PM2 list -----------------------------------------------\r\n┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────┬───────────┬─────────┬──────────┐\r\n│ App name │ id │ mode │ pid   │ status │ restart │ uptime │ cpu │ mem       │ user    │ watching │\r\n├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────┼───────────┼─────────┼──────────┤\r\n│ app      │ 3  │ fork │ 10952 │ online │ 118     │ 74s    │ 0%  │ 44.0 MB   │ vagrant │ enabled  │\r\n│ client   │ 2  │ fork │ 10944 │ online │ 118     │ 74s    │ 0%  │ 42.3 MB   │ vagrant │ enabled  │\r\n│ core     │ 0  │ fork │ 10928 │ online │ 119     │ 74s    │ 0%  │ 42.4 MB   │ vagrant │ enabled  │\r\n│ site     │ 1  │ fork │ 10934 │ online │ 119     │ 74s    │ 0%  │ 35.1 MB   │ vagrant │ enabled  │\r\n└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────┴───────────┴─────────┴──────────┘\r\n===============================================================================\r\n--- Daemon logs --------------------------------------------\r\n┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────┬───────────┬─────────┬──────────┐\r\n│ App name │ id │ mode │ pid   │ status │ restart │ uptime │ cpu │ mem       │ user    │ watching │\r\n├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────┼───────────┼─────────┼──────────┤\r\n│ app      │ 3  │ fork │ 10952 │ online │ 118     │ 74s    │ 0%  │ 44.0 MB   │ vagrant │ enabled  │\r\n│ client   │ 2  │ fork │ 10944 │ online │ 118     │ 74s    │ 0%  │ 42.3 MB   │ vagrant │ enabled  │\r\n│ core     │ 0  │ fork │ 10928 │ online │ 119     │ 74s    │ 0%  │ 42.4 MB   │ vagrant │ enabled  │\r\n│ site     │ 1  │ fork │ 10934 │ online │ 119     │ 74s    │ 0%  │ 35.1 MB   │ vagrant │ enabled  │\r\n└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────┴───────────┴─────────┴──────────┘\r\n Use `pm2 show <id|name>` to get more details about an app\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/Unitech/pm2/issues/comments/334691316","html_url":"https://github.com/Unitech/pm2/issues/3196#issuecomment-334691316","issue_url":"https://api.github.com/repos/Unitech/pm2/issues/3196","id":334691316,"user":{"login":"vmarchaud","id":2820968,"avatar_url":"https://avatars3.githubusercontent.com/u/2820968?v=4","gravatar_id":"","url":"https://api.github.com/users/vmarchaud","html_url":"https://github.com/vmarchaud","followers_url":"https://api.github.com/users/vmarchaud/followers","following_url":"https://api.github.com/users/vmarchaud/following{/other_user}","gists_url":"https://api.github.com/users/vmarchaud/gists{/gist_id}","starred_url":"https://api.github.com/users/vmarchaud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmarchaud/subscriptions","organizations_url":"https://api.github.com/users/vmarchaud/orgs","repos_url":"https://api.github.com/users/vmarchaud/repos","events_url":"https://api.github.com/users/vmarchaud/events{/privacy}","received_events_url":"https://api.github.com/users/vmarchaud/received_events","type":"User","site_admin":false},"created_at":"2017-10-06T08:24:35Z","updated_at":"2017-10-06T08:24:35Z","author_association":"COLLABORATOR","body":"You can change the `cwd` config without deleting the process and starting it (ie reload should not pick this changement)."}}
{"actor":{"display_login":"vmarchaud"}}