@@ -, +, @@ --- tools/stage-marc-import.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/tools/stage-marc-import.pl +++ a/tools/stage-marc-import.pl @@ -31,6 +31,7 @@ use CGI qw ( -utf8 ); use CGI::Cookie; use MARC::File::USMARC; use Net::Server::Daemonize qw(daemonize); +use File::Temp qw(tempdir); # Koha modules used use C4::Context; @@ -120,10 +121,11 @@ if ($completedJobID) { exit 0; } elsif (defined $pid) { # Daemonize the child process os the parent will print its output - my $pidfile = "/tmp/async$$.pid"; # deamonize requires a pid file even though it is supposed to be optional + # deamonize requires a pid file even though it is supposed to be optional + my $dir = tempdir( CLEANUP => 1 ); + my $pidfile = "$dir/async$$.pid"; my @current_user = getpwuid($<); daemonize( $current_user[2], $current_user[3], $pidfile ); - unlink($pidfile); # otherwise it doesn't go away # child # close STDOUT to signal to Apache that # we're now running in the background --