Jailkit and MYSQL - mysqld.sock can't be linked to tmpfs /run

Discussion in 'Installation/Configuration' started by CubAfull, Mar 31, 2017.

  1. CubAfull

    CubAfull Member

    Hello!
    Some of my clients need access to mysql, php, composer from chrooted shell accounts. I made the necessary changes and everything is working fine except MYSQL.
    I found this error in the ISPConfig log:
    Code:
    ln: creating hard link '/var/www/clients/client15/web2/var/run/mysqld/mysqld.sock' => '/var/run/mysqld/mysqld.sock': Invalid cross-device link
    In /usr/local/ispconfig/server/scripts/create_jailkit_chroot.sh ISPConfig try to create this link, but you can't make hard link from two different partitions.
    In debian/ubuntu (and many more) by default the /run (/var/run) is a tmpfs mounted partition!
    I can mount /var/run/mysqld in /var/www/clients/client15/web2/var/run/mysqld/ but after reboot setting will lost!
    Please, how can I solve this problem?
    df -h output:
    Code:
    /dev/md2        1.8T   17G  1.7T   1% /
    udev             10M     0   10M   0% /dev
    tmpfs           3.2G  197M  3.0G   7% /run
    tmpfs           7.9G     0  7.9G   0% /dev/shm
    tmpfs           5.0M     0  5.0M   0% /run/lock
    tmpfs           7.9G     0  7.9G   0% /sys/fs/cgroup
    /dev/md0        180M   33M  135M  20% /boot
    
    mount output:
    Code:
    -------------
    tmpfs on /run type tmpfs (rw,nosuid,relatime,size=3285232k,mode=755)
    /dev/md2 on / type ext4 (rw,noatime,nodiratime,errors=remount-ro,stripe=256,data=ordered,jqfmt=vfsv0,usrjquota=quota.user,grpjquota=quota.group)
    -------------
    Regard,
    Michael
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The best way to use MySQL from within a jail is to use the IP 127.0.0.1 to connect and not "localhost", using the IP ensures that the application tries to connect to MySQL over the network and is not using the socket.
     
    biforme likes this.

Share This Page