diff --git a/Netdisco/Changes b/Netdisco/Changes index f81037db..2f43b016 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -5,6 +5,7 @@ * Rewrite of the daemon to use Daemon::Control and MCE (cleaner netdisco code and fewer deps) * Added daemonized version of the web-app server also using Daemon::Control + * Daemons now log to ~/logs/netdisco-{web,daemon}.log * Version bump so that we'll be releasing odd numbered beta dists [BUG FIXES] diff --git a/Netdisco/bin/netdisco-daemon b/Netdisco/bin/netdisco-daemon index 932330ba..274b410e 100755 --- a/Netdisco/bin/netdisco-daemon +++ b/Netdisco/bin/netdisco-daemon @@ -10,10 +10,16 @@ BEGIN { } } +use Path::Class; +my $log_dir = dir($ENV{HOME}, 'logs'); +mkdir $log_dir if ! -d $log_dir; + my $program = "$ENV{HOME}/bin/netdisco-daemon-fg"; Daemon::Control->new({ name => 'Netdisco Daemon', program => ($ENV{NETDISCO_DAEMON} || $program), pid_file => "$ENV{HOME}/netdisco-daemon.pid", + stderr_file => file($log_dir, 'netdisco-daemon.log'), + stdout_file => file($log_dir, 'netdisco-daemon.log'), })->run; diff --git a/Netdisco/bin/netdisco-web b/Netdisco/bin/netdisco-web index 8ede034c..de75a4b8 100755 --- a/Netdisco/bin/netdisco-web +++ b/Netdisco/bin/netdisco-web @@ -10,9 +10,15 @@ BEGIN { } } +use Path::Class; +my $log_dir = dir($ENV{HOME}, 'logs'); +mkdir $log_dir if ! -d $log_dir; + Daemon::Control->new({ name => 'Netdisco Web', program => 'plackup', program_args => ["$ENV{HOME}/bin/netdisco-web-fg"], pid_file => "$ENV{HOME}/netdisco-web.pid", + stderr_file => file($log_dir, 'netdisco-web.log'), + stdout_file => file($log_dir, 'netdisco-web.log'), })->run;