mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2024-09-19 19:22:14 +02:00
explode if $run_dir is not specified; make a config setting and perhaps shift the onus onto the user rather than having to deal with tmpfiles.d etc
See: https://github.com/postfixadmin/postfixadmin/issues/78
This commit is contained in:
parent
80418e6412
commit
f8713651cc
@ -26,6 +26,9 @@ our $db_username="mail";
|
|||||||
# database password
|
# database password
|
||||||
our $db_password="CHANGE_ME!";
|
our $db_password="CHANGE_ME!";
|
||||||
|
|
||||||
|
# Where to create a lockfile; please ensure path exists.
|
||||||
|
our $run_dir="/var/run/fetchmail";
|
||||||
|
|
||||||
# instead of changing this script, you can put your settings to /etc/mail/postfixadmin/fetchmail.conf
|
# instead of changing this script, you can put your settings to /etc/mail/postfixadmin/fetchmail.conf
|
||||||
# just use perl syntax there to fill the variables listed above (without the "our" keyword). Example:
|
# just use perl syntax there to fill the variables listed above (without the "our" keyword). Example:
|
||||||
# $db_username = 'mail';
|
# $db_username = 'mail';
|
||||||
@ -40,7 +43,7 @@ if (-f "/etc/mail/postfixadmin/fetchmail.conf") {
|
|||||||
openlog("fetchmail-all", "pid", "mail");
|
openlog("fetchmail-all", "pid", "mail");
|
||||||
|
|
||||||
sub log_and_die {
|
sub log_and_die {
|
||||||
my($message) = @_;
|
my($message) = @_;
|
||||||
syslog("err", $message);
|
syslog("err", $message);
|
||||||
die $message;
|
die $message;
|
||||||
}
|
}
|
||||||
@ -59,8 +62,6 @@ while ($_ = shift @ARGS1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$run_dir="/var/run/fetchmail";
|
|
||||||
|
|
||||||
# use specified config file
|
# use specified config file
|
||||||
if (-e $configfile) {
|
if (-e $configfile) {
|
||||||
do $configfile;
|
do $configfile;
|
||||||
@ -72,6 +73,10 @@ if($db_type eq "Pg" || $db_type eq "mysql") {
|
|||||||
log_and_die "unsupported db_type $db_type";
|
log_and_die "unsupported db_type $db_type";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!-d $run_dir) {
|
||||||
|
log_and_die("Please create: $run_dir");
|
||||||
|
}
|
||||||
|
|
||||||
$lock_file=$run_dir . "/fetchmail-all.lock";
|
$lock_file=$run_dir . "/fetchmail-all.lock";
|
||||||
|
|
||||||
$lockmgr = LockFile::Simple->make(-autoclean => 1, -max => 1);
|
$lockmgr = LockFile::Simple->make(-autoclean => 1, -max => 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user