The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

mysql.sock and jailshell

Discussion in 'General Discussion' started by sparek-3, Dec 15, 2004.

  1. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,381
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    When trying to access MySQL databases through the shell, using jailshell, we get the error message

    ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)

    There is a mysql.sock file in the /tmp directory and in /home/virtfs/user/tmp .

    The server is running FreeBSD 4.9.
     
  2. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    We're having this same issue on RHEL 3.
     
  3. dezignguy

    dezignguy Well-Known Member

    Joined:
    Sep 26, 2004
    Messages:
    534
    Likes Received:
    0
    Trophy Points:
    16
    you should probably recreate the mysql.sock file in the tmp directories... you can search the forums her eto find out how to do that... basically you make a symbolic link with

    ln -s
     
  4. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    Simply doing 'ln -s /var/lib/mysql/mysql.sock /var/tmp/mysql.sock' will not fix the jailshell from properly having the /var/tmp directory.
     
  5. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    It appears the only way to patch it (since the internals of jailshell do not recognize the /var/tmp directory) is to actually:

    1) Force the creation of the necessary directory (for every jailshell user):

    mkdir /home/virtfs/username/var/tmp

    2) Adjust permissions by:

    chown root:username /home/virtfs/username/var/tmp

    3) Create a symbolic link via:

    ln -s /var/lib/mysql/mysql.sock /home/virtfs/username/var/tmp/mysql.sock

    This of course is a bit of a hack job but does seem to patch the problem. cPanel though should of course fix the jailshell internals to automatically recognize the /var/tmp directory and the subsequent mysql.sock file under it.
     
  6. dezignguy

    dezignguy Well-Known Member

    Joined:
    Sep 26, 2004
    Messages:
    534
    Likes Received:
    0
    Trophy Points:
    16
    Sorry, I missed the jail shell specific part...
     
Loading...

Share This Page