From 340a502202fc5c922591b6d06b739a2467c926ca Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Mon, 25 Dec 2023 07:30:08 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E2=80=94=20Add=20a=20=20setting=20?= =?UTF-8?q?(fix=20#242)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG | 1 + lib/Lufi.pm | 3 +++ lufi.conf.template | 8 ++++++++ t/mysql.conf | 8 ++++++++ t/postgresql.conf | 8 ++++++++ t/sqlite.conf | 8 ++++++++ 6 files changed, 36 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 220da32..0ec7ec4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,6 +7,7 @@ Revision history for Lufi - ➖ — Replace moment.js with Date().toLocaleDateString(…) - 🩹 — Fix Roboto font warnings in js console - ♿️ — Add autofocus on login input field + - ✨ — Add a `lockfile_dir` setting (fix #242) 0.06.00 2023-12-18 - ⬆️ — Update deps diff --git a/lib/Lufi.pm b/lib/Lufi.pm index e68c9fd..3e15d70 100644 --- a/lib/Lufi.pm +++ b/lib/Lufi.pm @@ -79,6 +79,9 @@ sub startup { my $loop = shift; my $lockfile = Mojo::File->new($config_file)->basename('.conf').'-provisioning.lock'; + if (defined($config->{lockfile_dir})) { + $lockfile = Mojo::File->new($config->{lockfile_dir}, $lockfile)->to_string; + } if (-e $lockfile) { my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($lockfile); diff --git a/lufi.conf.template b/lufi.conf.template index 2b71b03..a9f43b7 100644 --- a/lufi.conf.template +++ b/lufi.conf.template @@ -149,6 +149,14 @@ # 1 => 'Illegal content', #}, + # Lockfile directory + # In which directory do you want to store the lockfile? + # If using load balancing, you will want to set a directory shared by the servers + # You can define it relative to lufi directory or set an absolute path + # Remember that it has to be in a directory writable by Lufi user + # optional, default is lufi directory + #lockfile_dir => '.', + ############### # Mail settings ############### diff --git a/t/mysql.conf b/t/mysql.conf index 1b8524c..b1060a9 100644 --- a/t/mysql.conf +++ b/t/mysql.conf @@ -139,6 +139,14 @@ 1 => 'Illegal content', }, + # Lockfile directory + # In which directory do you want to store the lockfile? + # If using load balancing, you will want to set a directory shared by the servers + # You can define it relative to lufi directory or set an absolute path + # Remember that it has to be in a directory writable by Lufi user + # optional, default is lufi directory + #lockfile_dir => '.', + ############### # Mail settings ############### diff --git a/t/postgresql.conf b/t/postgresql.conf index 8905779..a07c392 100644 --- a/t/postgresql.conf +++ b/t/postgresql.conf @@ -135,6 +135,14 @@ 1 => 'Illegal content', }, + # Lockfile directory + # In which directory do you want to store the lockfile? + # If using load balancing, you will want to set a directory shared by the servers + # You can define it relative to lufi directory or set an absolute path + # Remember that it has to be in a directory writable by Lufi user + # optional, default is lufi directory + #lockfile_dir => '.', + ############### # Mail settings ############### diff --git a/t/sqlite.conf b/t/sqlite.conf index c1d33ee..91d0ae1 100644 --- a/t/sqlite.conf +++ b/t/sqlite.conf @@ -139,6 +139,14 @@ 1 => 'Illegal content', }, + # Lockfile directory + # In which directory do you want to store the lockfile? + # If using load balancing, you will want to set a directory shared by the servers + # You can define it relative to lufi directory or set an absolute path + # Remember that it has to be in a directory writable by Lufi user + # optional, default is lufi directory + #lockfile_dir => '.', + ############### # Mail settings ###############