Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Incorrect ssh exit status

Discussion in 'General Discussion' started by ssss, Jun 7, 2006.

  1. ssss

    ssss Registered

    Jun 7, 2006
    Likes Received:
    Trophy Points:
    I use a hosting company that uses cPanel. I have jailshell ssh access on a nonstandard port. Whenever I use ssh, it returns zero, rather than the exit code of the remote process as it should. I suspect the jailshell has a bug and does not return the exit code of the last process it executes as it should, but I have no way of testing the theory or anything. E.g.

    ssh -p 1234 exit 5
    echo $?

    prints 0, not 5!

    Is this a bug? Or is there some reason for this strange behaviour (if there is a reason, I have no idea what it could be). It's very unlikely to be an OpenSSH problem, as SSH works fine with similar versions on a number of different servers I have access to, though they all use regular shells.

    The exit code is really crucial to scripts and so on, so it would be heaps more helpful if it worked. At the moment I have written a kludge/workaround that saves the exit code in a temporary file on the server and then downloads it...far from ideal and slow and still susceptible to errors...but better...

    My company keep up to date with cPanel updates, so as soon as the bug is fixed, I will get the benefit. Keen to see the bug found and fixed!

    Anyone have any ideas/knowledge? Anyone able to confirm the theory that the jailshell is at fault (e.g. by running the jailshell from another shell and checking the exit code)? Should I submit the bug to Bugzilla?

  2. chirpy

    chirpy Well-Known Member

    Jun 15, 2002
    Likes Received:
    Trophy Points:
    Go on, have a guess
    If it's reporducable you should log it in bugzilla if you want cPanel to look at it.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice