max-mapper / linux

run Linux on Yosemite easily from the CLI
http://hyperos.io/
458 stars 22 forks source link

'linux kill' should have a nicer error if you don't use sudo #9

Closed OmgImAlexis closed 7 years ago

OmgImAlexis commented 9 years ago

I had to use linux halt to get it to stop. kill doesn't do anything but throw an error.

➜  ~  linux kill
/Users/xo/.nvm/versions/node/v4.0.0/lib/node_modules/linux/cli.js:91
        if (err) throw err
                 ^

Error: kill EPERM
    at exports._errnoException (util.js:837:11)
    at process.kill (node.js:764:15)
    at killPid (/Users/xo/.nvm/versions/node/v4.0.0/lib/node_modules/linux/node_modules/daemonspawn/node_modules/tree-kill/index.js:51:17)
    at /Users/xo/.nvm/versions/node/v4.0.0/lib/node_modules/linux/node_modules/daemonspawn/node_modules/tree-kill/index.js:43:13
    at Array.forEach (native)
    at killAll (/Users/xo/.nvm/versions/node/v4.0.0/lib/node_modules/linux/node_modules/daemonspawn/node_modules/tree-kill/index.js:35:23)
    at /Users/xo/.nvm/versions/node/v4.0.0/lib/node_modules/linux/node_modules/daemonspawn/node_modules/tree-kill/index.js:17:17
    at ChildProcess.<anonymous> (/Users/xo/.nvm/versions/node/v4.0.0/lib/node_modules/linux/node_modules/daemonspawn/node_modules/tree-kill/index.js:72:17)
    at ChildProcess.<anonymous> (/Users/xo/.nvm/versions/node/v4.0.0/lib/node_modules/linux/node_modules/daemonspawn/node_modules/tree-kill/node_modules/once/once.js:17:15)
    at emitTwo (events.js:87:13)
max-mapper commented 9 years ago

for kill you have to use sudo, the EPERM error there is because you didn't have permission to kill the process. we should probably clean up that error message so it's easier to understand. but you usually wanna use linux halt anyway so it can gracefully shut down

On Thursday, September 10, 2015, X O notifications@github.com wrote:

I had to use linux halt to get it to stop. kill doesn't do anything but throw an error.

➜ ~ linux kill /Users/xo/.nvm/versions/node/v4.0.0/lib/node_modules/linux/cli.js:91 if (err) throw err ^

Error: kill EPERM at exports._errnoException (util.js:837:11) at process.kill (node.js:764:15) at killPid (/Users/xo/.nvm/versions/node/v4.0.0/lib/node_modules/linux/node_modules/daemonspawn/node_modules/tree-kill/index.js:51:17) at /Users/xo/.nvm/versions/node/v4.0.0/lib/node_modules/linux/node_modules/daemonspawn/node_modules/tree-kill/index.js:43:13 at Array.forEach (native) at killAll (/Users/xo/.nvm/versions/node/v4.0.0/lib/node_modules/linux/node_modules/daemonspawn/node_modules/tree-kill/index.js:35:23) at /Users/xo/.nvm/versions/node/v4.0.0/lib/node_modules/linux/node_modules/daemonspawn/node_modules/tree-kill/index.js:17:17 at ChildProcess. (/Users/xo/.nvm/versions/node/v4.0.0/lib/node_modules/linux/node_modules/daemonspawn/node_modules/tree-kill/index.js:72:17) at ChildProcess. (/Users/xo/.nvm/versions/node/v4.0.0/lib/node_modules/linux/node_modules/daemonspawn/node_modules/tree-kill/node_modules/once/once.js:17:15) at emitTwo (events.js:87:13)

— Reply to this email directly or view it on GitHub https://github.com/maxogden/linux/issues/9.

Sent from my phone

OmgImAlexis commented 9 years ago

@maxogden so it's still an issue just not the one I thought it was.