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 ###############