Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    1

    Default Incorrect ssh exit status

    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 mylogin@myhostingcompany.com 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?

    Ben.

  2. #2
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    If it's reporducable you should log it in bugzilla if you want cPanel to look at it.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

Similar Threads & Tags
Similar threads

  1. httpd status with details from ssh
    By LAZer in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 07-01-2010, 01:25 PM
  2. exit signal Bus error (7)
    By rvbalraj in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 08-05-2008, 12:46 PM
  3. "Status Warning" - SSH continually restarting after port change
    By n000b in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 09-04-2007, 06:44 PM
  4. mysql failing on ssh exit
    By donniesd in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 04-07-2006, 05:50 PM
  5. Check Server in SSH (the service status in whm, but in ssh)
    By drumhtd in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-30-2005, 05:16 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube