I want postfix
to be able to talk to mysql
, without letting it out of its chroot
.
I guessed that moving the socket-file in to the chroot
, should solve it, but that wasn't as easy.
If i try to update all references I can find of /var/run/mysqld
to /var/spool/postfix/var/run/mysqld
.
Mysql want start, and ask me to run systemctl status mysql.service
, then I get:
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: activating (start-post) (Result: exit-code) since tis 2016-09-06 08:46:34 CEST; 7s ago
Process: 2747 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
Process: 2743 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 2747 (code=exited, status=1/FAILURE);
: 2748 (mysql-systemd-s)
CGroup: /system.slice/mysql.service
└─control
├─2748 /bin/bash /usr/share/mysql/mysql-systemd-start post
└─2790 sleep 1
sep 06 08:46:34 kglive systemd[1]: Starting MySQL Community Server...
sep 06 08:46:36 kglive systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
and grep ERROR /var/log/mysql/error.log
repeats:
2016-09-06T06:41:24.615150Z 0 [ERROR] Could not create unix socket lock file /var/spool/postfix/var/run/mysqld/mysqld.sock.lock.
2016-09-06T06:41:24.615154Z 0 [ERROR] Unable to setup unix socket lock file.
2016-09-06T06:41:24.615158Z 0 [ERROR] Aborting
Currently, I use a manual mount-bind between the dirs, but I have to redo it after each reboot, using ln -s /var/spool/postfix/var/run/mysqld /var/run/mysqld
or putting the-mount in /etc/fstab
didn't help, I guess its because starting mysqld recreated the /var/run/mysqld
folder when its starts.
- Is it possible to move the socket-file?
- What other options are available?
(I know about letting postfix out of chroot, but I hope I don't have to)
I think the mount-bind solution stops working on a service mysql restart
.
0 Answers