From 630bce5f299862a1bb6cef42c4155daddc035093 Mon Sep 17 00:00:00 2001 From: Dirk Weise Date: Fri, 18 Jan 2019 17:36:30 +0100 Subject: [PATCH] imapsync: Connect to database via socket MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the imapsync script connect to mysql via socket and not tcp like all other services do. Reasoning: consistency. 🤓 And in my case the database does not listen on tcp; just on the socket. --- data/Dockerfiles/dovecot/imapsync_cron.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/Dockerfiles/dovecot/imapsync_cron.pl b/data/Dockerfiles/dovecot/imapsync_cron.pl index 1976f8ec..1ce46c4c 100755 --- a/data/Dockerfiles/dovecot/imapsync_cron.pl +++ b/data/Dockerfiles/dovecot/imapsync_cron.pl @@ -31,7 +31,7 @@ $DBUSER = ''; $DBPASS = ''; $run_dir="/tmp"; -$dsn = "DBI:mysql:database=" . $DBNAME . ";host=mysql"; +$dsn = "DBI:mysql:database=" . $DBNAME . ";mysql_socket=/var/run/mysqld/mysqld.sock"; $lock_file = $run_dir . "/imapsync_busy"; $lockmgr = LockFile::Simple->make(-autoclean => 1, -max => 1); $lockmgr->lock($lock_file) || die "can't lock ${lock_file}";