{"action":"created","issue":{"url":"https://api.github.com/repos/Unitech/PM2/issues/1197","labels_url":"https://api.github.com/repos/Unitech/PM2/issues/1197/labels{/name}","comments_url":"https://api.github.com/repos/Unitech/PM2/issues/1197/comments","events_url":"https://api.github.com/repos/Unitech/PM2/issues/1197/events","html_url":"https://github.com/Unitech/PM2/issues/1197","id":69539046,"number":1197,"title":"Unable to use the --name option","user":{"login":"narf","id":458263,"avatar_url":"https://avatars.githubusercontent.com/u/458263?v=3","gravatar_id":"","url":"https://api.github.com/users/narf","html_url":"https://github.com/narf","followers_url":"https://api.github.com/users/narf/followers","following_url":"https://api.github.com/users/narf/following{/other_user}","gists_url":"https://api.github.com/users/narf/gists{/gist_id}","starred_url":"https://api.github.com/users/narf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/narf/subscriptions","organizations_url":"https://api.github.com/users/narf/orgs","repos_url":"https://api.github.com/users/narf/repos","events_url":"https://api.github.com/users/narf/events{/privacy}","received_events_url":"https://api.github.com/users/narf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"jorge-d","id":1178099,"avatar_url":"https://avatars.githubusercontent.com/u/1178099?v=3","gravatar_id":"","url":"https://api.github.com/users/jorge-d","html_url":"https://github.com/jorge-d","followers_url":"https://api.github.com/users/jorge-d/followers","following_url":"https://api.github.com/users/jorge-d/following{/other_user}","gists_url":"https://api.github.com/users/jorge-d/gists{/gist_id}","starred_url":"https://api.github.com/users/jorge-d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorge-d/subscriptions","organizations_url":"https://api.github.com/users/jorge-d/orgs","repos_url":"https://api.github.com/users/jorge-d/repos","events_url":"https://api.github.com/users/jorge-d/events{/privacy}","received_events_url":"https://api.github.com/users/jorge-d/received_events","type":"User","site_admin":false},"milestone":null,"comments":7,"created_at":"2015-04-20T08:49:51Z","updated_at":"2015-05-07T12:17:23Z","closed_at":"2015-04-29T15:05:21Z","body":"Using pm2 v0.12.11\r\n\r\n    pm2 start server.js --name hop\r\n\r\nGives me this:\r\n\r\n    ┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────────────┬──────────┐\r\n    │ App name │ id │ mode │ pid   │ status │ restart │ uptime │ memory      │ watching │\r\n    ├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────────────┼──────────┤\r\n    │ server   │ 0  │ fork │ 23863 │ online │ 0       │ 0s     │ 20.688 MB   │ disabled │\r\n    └──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────────────┴──────────┘\r\n\r\n\r\n\r\nThe app name does not correspond the one i gave him, and then \r\n\r\n    pm2 stop hop\r\n\r\ngives me: \r\n\r\n    [PM2] Stopping hop\r\n    [PM2][ERROR] Process hop not found\r\n\r\nSame thing occur when using in nodejs with require(\"pm2\")\r\n\r\n\r\n\r\npm2 logs give this:\r\n\r\n    PM2: 2015-04-20 10:51:23: Starting execution sequence in -fork mode- for app name:server id:0\r\n    PM2: 2015-04-20 10:51:23: App name:server id:0 online\r\n"},"comment":{"url":"https://api.github.com/repos/Unitech/PM2/issues/comments/99841758","html_url":"https://github.com/Unitech/PM2/issues/1197#issuecomment-99841758","issue_url":"https://api.github.com/repos/Unitech/PM2/issues/1197","id":99841758,"user":{"login":"yegodz","id":3387018,"avatar_url":"https://avatars.githubusercontent.com/u/3387018?v=3","gravatar_id":"","url":"https://api.github.com/users/yegodz","html_url":"https://github.com/yegodz","followers_url":"https://api.github.com/users/yegodz/followers","following_url":"https://api.github.com/users/yegodz/following{/other_user}","gists_url":"https://api.github.com/users/yegodz/gists{/gist_id}","starred_url":"https://api.github.com/users/yegodz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yegodz/subscriptions","organizations_url":"https://api.github.com/users/yegodz/orgs","repos_url":"https://api.github.com/users/yegodz/repos","events_url":"https://api.github.com/users/yegodz/events{/privacy}","received_events_url":"https://api.github.com/users/yegodz/received_events","type":"User","site_admin":false},"created_at":"2015-05-07T12:17:23Z","updated_at":"2015-05-07T12:17:23Z","body":"Thanks @jorge-d \r\nIt turns out that after I run `sudo pm2 delete xoApi` it deletes the `xoApi` name from the process list and then the next time I run `sudo -E pm2 start xoApi.js --name xoprod` it takes the name correctly.\r\nSo it seems that it associates only one name with a particular script at a time. Is that the intended behavior?\r\n\r\n(aside.. pm2 will not run without sudo -- I found the problem explained on an other issue here-will deal with that later)\r\n\r\n```\r\n08:11:03 ~/dev/xo/server [master]\r\n$> node --version\r\nv0.11.13\r\n08:11:10 ~/dev/xo/server [master]\r\n$> sudo pm2 --version\r\n0.12.14\r\n08:11:47 ~/dev/xo/server [master]\r\n$> sudo -E start xoApi.js \r\nsudo: start: command not found\r\n08:12:08 ~/dev/xo/server [master]\r\n$> sudo -E pm2 start xoApi.js \r\n[PM2] Process xoApi.js launched\r\n┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────────────┬──────────┐\r\n│ App name │ id │ mode │ pid   │ status │ restart │ uptime │ memory      │ watching │\r\n├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────────────┼──────────┤\r\n│ xoApi    │ 5  │ fork │ 49274 │ online │ 0       │ 0s     │ 16.777 MB   │ disabled │\r\n└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────────────┴──────────┘\r\n Use `pm2 show <id|name>` to get more details about an app\r\n08:12:20 ~/dev/xo/server [master]\r\n$> sudo pm2 stop xoApi\r\n[PM2] Stopping xoApi\r\n[PM2] stopProcessId process id 5\r\n┌──────────┬────┬──────┬─────┬─────────┬─────────┬────────┬────────┬──────────┐\r\n│ App name │ id │ mode │ pid │ status  │ restart │ uptime │ memory │ watching │\r\n├──────────┼────┼──────┼─────┼─────────┼─────────┼────────┼────────┼──────────┤\r\n│ xoApi    │ 5  │ fork │ 0   │ stopped │ 0       │ 0      │ 0 B    │ disabled │\r\n└──────────┴────┴──────┴─────┴─────────┴─────────┴────────┴────────┴──────────┘\r\n Use `pm2 show <id|name>` to get more details about an app\r\n08:12:35 ~/dev/xo/server [master]\r\n$> sudo -E pm2 start xoApi.js --name xoprod\r\n[PM2] restartProcessId process id 5\r\n[PM2] Process successfully started\r\n┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────────────┬──────────┐\r\n│ App name │ id │ mode │ pid   │ status │ restart │ uptime │ memory      │ watching │\r\n├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────────────┼──────────┤\r\n│ xoApi    │ 5  │ fork │ 49321 │ online │ 0       │ 0s     │ 17.016 MB   │ disabled │\r\n└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────────────┴──────────┘\r\n Use `pm2 show <id|name>` to get more details about an app\r\n08:13:05 ~/dev/xo/server [master]\r\n$> sudo pm2 stop xoApi\r\n[PM2] Stopping xoApi\r\n[PM2] stopProcessId process id 5\r\n┌──────────┬────┬──────┬─────┬─────────┬─────────┬────────┬────────┬──────────┐\r\n│ App name │ id │ mode │ pid │ status  │ restart │ uptime │ memory │ watching │\r\n├──────────┼────┼──────┼─────┼─────────┼─────────┼────────┼────────┼──────────┤\r\n│ xoApi    │ 5  │ fork │ 0   │ stopped │ 0       │ 0      │ 0 B    │ disabled │\r\n└──────────┴────┴──────┴─────┴─────────┴─────────┴────────┴────────┴──────────┘\r\n Use `pm2 show <id|name>` to get more details about an app\r\n08:13:12 ~/dev/xo/server [master]\r\n$> sudo pm2 delete xoApi\r\n[PM2] Deleting xoApi process\r\n[PM2] deleteProcessId process id 5\r\n┌──────────┬────┬──────┬─────┬────────┬─────────┬────────┬────────┬──────────┐\r\n│ App name │ id │ mode │ pid │ status │ restart │ uptime │ memory │ watching │\r\n└──────────┴────┴──────┴─────┴────────┴─────────┴────────┴────────┴──────────┘\r\n Use `pm2 show <id|name>` to get more details about an app\r\n08:13:28 ~/dev/xo/server [master]\r\n$> sudo -E pm2 start xoApi.js --name xoprod\r\n[PM2] Process xoApi.js launched\r\n┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────────────┬──────────┐\r\n│ App name │ id │ mode │ pid   │ status │ restart │ uptime │ memory      │ watching │\r\n├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────────────┼──────────┤\r\n│ xoprod   │ 6  │ fork │ 49374 │ online │ 0       │ 0s     │ 16.578 MB   │ disabled │\r\n└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────────────┴──────────┘\r\n Use `pm2 show <id|name>` to get more details about an app\r\n08:13:34 ~/dev/xo/server [master]\r\n$> \r\n```"}}