如何將 mysql.socket 移至 postfix chroot

如何將 mysql.socket 移至 postfix chroot

我希望postfix能夠與人交談mysql,而不讓它脫離它chroot

我猜想將套接字檔案移動到chroot, 應該可以解決這個問題,但這並不那麼容易。

如果我嘗試更新我能找到/var/run/mysqld的 所有參考資料/var/spool/postfix/var/run/mysqld

Mysql 想要啟動,並要求我運行systemctl status mysql.service,然後我得到:

● 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

grep ERROR /var/log/mysql/error.log重複:

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

目前,我在目錄之間使用手動掛載綁定,但我必須在每次重新啟動後重做它,使用ln -s /var/spool/postfix/var/run/mysqld /var/run/mysqld或放入掛載/etc/fstab並沒有幫助,我猜這是因為啟動 mysqld/var/run/mysqld在啟動時重新創建了資料夾。

  • 是否可以移動套接字檔?
  • 還有哪些其他選擇?

(我知道讓 postfix 脫離 chroot,但我希望我不必這樣做)
我認為 mount-bind 解決方案停止在service mysql restart.

相關內容