summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2016-11-23 15:25:31 -0800
committerMark Wells <mark@freeside.biz>2016-11-23 15:25:31 -0800
commitbcfa8b9c306cc871b5851d7c07ef0759eb1bcb31 (patch)
tree2b0aa3d69d1d5fd44004163d04a12c3050b0192e
parente42db9683dee82d6991a4205642d5babb3d52f2f (diff)
avoid setting logfile path too early, from #37802
-rw-r--r--FS/FS/Daemon.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/FS/FS/Daemon.pm b/FS/FS/Daemon.pm
index 4ecd80e98..a3c16d888 100644
--- a/FS/FS/Daemon.pm
+++ b/FS/FS/Daemon.pm
@@ -64,12 +64,6 @@ sub daemonize1 {
$SIG{TERM} = sub { warn "SIGTERM received; shutting down\n"; $sigterm++; };
}
- # set the logfile sensibly
- if (!$logfile) {
- my $logname = $me;
- $logname =~ s/^freeside-//;
- logfile("%%%FREESIDE_LOG%%%/$logname-log.$FS::UID::datasrc");
- }
}
sub drop_root {
@@ -122,6 +116,12 @@ sub _die {
sub _logmsg {
chomp( my $msg = shift );
+ # set the logfile sensibly
+ if (!$logfile) {
+ my $logname = $me;
+ $logname =~ s/^freeside-//;
+ logfile("%%%FREESIDE_LOG%%%/$logname-log.$FS::UID::datasrc");
+ }
my $log = new IO::File ">>$logfile";
flock($log, LOCK_EX);
seek($log, 0, 2);