Issue
Hello.
In an installation almalinux 9 + cloudlinux with directadmin, the users
can't access /var/lib/mysql/mysql.sock
ie:
cagefs_enter_user babbo ls /var/lib/mysql/mysql.sock
ls: cannot access '/var/lib/mysql/mysql.sock': No such file or directory
This prevent users from using "localhost" to access their databases.
> # cat /etc/os-release
> NAME="CloudLinux"
> VERSION="9.6 (Georgy Dobrovolsky)"
> ID="cloudlinux"
> ID_LIKE="rhel centos fedora"
> VERSION_ID="9.6"
> PLATFORM_ID="platform:el9"
> PRETTY_NAME="CloudLinux 9.6 (Georgy Dobrovolsky)"
> ANSI_COLOR="0;34"
> LOGO="fedora-logo-icon"
> CPE_NAME="cpe:/o:cloudlinux:cloudlinux:9::baseos"
> HOME_URL="https://www.cloudlinux.com"
> DOCUMENTATION_URL="https://docs.cloudlinux.com"
> BUG_REPORT_URL="https://cloudlinux.zendesk.com"
> REDHAT_SUPPORT_PRODUCT="CloudLinux"
> REDHAT_SUPPORT_PRODUCT_VERSION="9.6"
> # mysql
> Welcome to the MySQL monitor. Commands end with ; or \g.
> Your MySQL connection id is 32
> Server version: 8.0.43-cll-lve MySQL Community Server - GPL
>
> Copyright (c) 2000, 2025, Oracle and/or its affiliates.
>
> Oracle is a registered trademark of Oracle Corporation and/or its
> affiliates. Other names may be trademarks of their respective
> owners.
>
> mysql> SHOW VARIABLES LIKE 'socket';
> +---------------+---------------------------+
> | Variable_name | Value |
> +---------------+---------------------------+
> | socket | /var/lib/mysql/mysql.sock |
> +---------------+---------------------------+
> 1 row in set (0.01 sec)
> Type 'help;' or '\h' for help. Type '\c' to clear the current input
> statement.
How can I give access to /var/lib/mysql/mysql.sock inside cages (without
mounting the whole /var/lib/mysql dir) ?
Environment
- CloudLinux
- Directadmin
Solution
To address the problem with the MySQL directory, it should already be mounted within CageFS. To verify this, could you please execute the following command to check the MySQL mount point?
grep mysql /etc/cagefs/cagefs.mp
If the mount point is confirmed to be present, the next step is to update the CageFS skeleton and remount all users. You can do this by running the following commands:
cagefsctl --force-update cagefsctl --force-update-etc cagefsctl --remount-all
Comments
0 comments
Please sign in to leave a comment.