{"action":"created","issue":{"url":"https://api.github.com/repos/tessel/t2-cli/issues/222","labels_url":"https://api.github.com/repos/tessel/t2-cli/issues/222/labels{/name}","comments_url":"https://api.github.com/repos/tessel/t2-cli/issues/222/comments","events_url":"https://api.github.com/repos/tessel/t2-cli/issues/222/events","html_url":"https://github.com/tessel/t2-cli/issues/222","id":96777185,"number":222,"title":"t2 run doesn't exit and leaves process hanging around","user":{"login":"LinusU","id":189580,"avatar_url":"https://avatars.githubusercontent.com/u/189580?v=3","gravatar_id":"","url":"https://api.github.com/users/LinusU","html_url":"https://github.com/LinusU","followers_url":"https://api.github.com/users/LinusU/followers","following_url":"https://api.github.com/users/LinusU/following{/other_user}","gists_url":"https://api.github.com/users/LinusU/gists{/gist_id}","starred_url":"https://api.github.com/users/LinusU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LinusU/subscriptions","organizations_url":"https://api.github.com/users/LinusU/orgs","repos_url":"https://api.github.com/users/LinusU/repos","events_url":"https://api.github.com/users/LinusU/events{/privacy}","received_events_url":"https://api.github.com/users/LinusU/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-07-23T10:08:53Z","updated_at":"2015-07-26T01:13:27Z","closed_at":null,"body":"Running scripts with `t2 run` doesn't exit when the script is finished. This forces me to press `ctrl + c` after a while. When I do this it prints `INFO Stopping script...` and then stops the process on my computer. But node is still left running on the device which causes problems if you try to run another scripts.\r\n\r\n**index.js**\r\n```javascript\r\nvar tessel = require('tessel')\r\n\r\nconsole.log('It works')\r\n```\r\n\r\n**`t2 run index.js`**\r\n```text\r\nINFO Connecting to Tessel...\r\nINFO Connected to Tessel-02A3DB18BE3D over LAN\r\nINFO Writing index.js to RAM on Tessel-02A3DB18BE3D (36.352 kB)...\r\nINFO Deployed.\r\nINFO Running index.js...\r\nIt works\r\n^CINFO Stopping script...\r\n```\r\n\r\n**`ps | grep node` on device**\r\n```text\r\nroot@Tessel-02A3DB18BE3D:(unknown)# ps | grep node\r\n 1705 root      1484 S    ash -c node '/tmp/remote-script/tests/test.js'\r\n 1706 root     35404 S    node /tmp/remote-script/tests/test.js\r\n 1716 root      1480 S    grep node\r\n```\r\n\r\n**errors on device next time**\r\n```text\r\nsock err { [Error: connect EAGAIN /var/run/tessel/port_a]\r\n  code: 'EAGAIN',\r\n  errno: 'EAGAIN',\r\n  syscall: 'connect',\r\n  address: '/var/run/tessel/port_a' }\r\nsock err { [Error: connect EAGAIN /var/run/tessel/port_b]\r\n  code: 'EAGAIN',\r\n  errno: 'EAGAIN',\r\n  syscall: 'connect',\r\n  address: '/var/run/tessel/port_b' }\r\n\r\nError: Port socket closed\r\n    at Socket.<anonymous> (/usr/lib/node/tessel.js:37:15)\r\n    at emitOne (events.js:77:13)\r\n    at Socket.emit (events.js:169:7)\r\n    at Pipe._onclose (net.js:467:12)\r\nError: Port socket closed\r\n    at Socket.<anonymous> (/usr/lib/node/tessel.js:37:15)\r\n    at emitOne (events.js:77:13)\r\n    at Socket.emit (events.js:169:7)\r\n    at Pipe._onclose (net.js:467:12)\r\n```"},"comment":{"url":"https://api.github.com/repos/tessel/t2-cli/issues/comments/124924704","html_url":"https://github.com/tessel/t2-cli/issues/222#issuecomment-124924704","issue_url":"https://api.github.com/repos/tessel/t2-cli/issues/222","id":124924704,"user":{"login":"johnnyman727","id":432909,"avatar_url":"https://avatars.githubusercontent.com/u/432909?v=3","gravatar_id":"","url":"https://api.github.com/users/johnnyman727","html_url":"https://github.com/johnnyman727","followers_url":"https://api.github.com/users/johnnyman727/followers","following_url":"https://api.github.com/users/johnnyman727/following{/other_user}","gists_url":"https://api.github.com/users/johnnyman727/gists{/gist_id}","starred_url":"https://api.github.com/users/johnnyman727/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnnyman727/subscriptions","organizations_url":"https://api.github.com/users/johnnyman727/orgs","repos_url":"https://api.github.com/users/johnnyman727/repos","events_url":"https://api.github.com/users/johnnyman727/events{/privacy}","received_events_url":"https://api.github.com/users/johnnyman727/received_events","type":"User","site_admin":false},"created_at":"2015-07-26T01:13:27Z","updated_at":"2015-07-26T01:13:27Z","body":"Moving over to the `t2-firmware` repo: https://github.com/tessel/t2-firmware/issues/80"}}