From f42ab6ff735ee465528de5b72e8975eefea97494 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Wed, 31 May 2017 19:05:16 +0100 Subject: [PATCH] also move PID file here --- bin/netdisco-backend | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/netdisco-backend b/bin/netdisco-backend index 7f43b614..ce11d99c 100755 --- a/bin/netdisco-backend +++ b/bin/netdisco-backend @@ -56,11 +56,15 @@ my $log_file = file($log_dir, 'netdisco-backend.log'); my $uid = (stat($netdisco->stringify))[4] || 0; my $gid = (stat($netdisco->stringify))[5] || 0; +my $old_pid = file($home, 'netdisco-daemon.pid'); +my $new_pid = file($home, 'netdisco-backend.pid'); +if (-f $old_pid) { File::Copy::move( $old_pid, $new_pid ) } + Daemon::Control->new({ name => 'Netdisco Backend', program => \&restarter, program_args => [@args], - pid_file => file($home, 'netdisco-backend.pid'), + pid_file => $new_pid, stderr_file => $log_file, stdout_file => $log_file, redirect_before_fork => 0,