move old PID file to new name
This commit is contained in:
@@ -3,17 +3,22 @@
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
use File::Spec;
|
|
||||||
use Cwd 'realpath';
|
|
||||||
|
|
||||||
use FindBin;
|
use FindBin;
|
||||||
FindBin::again();
|
FindBin::again();
|
||||||
|
|
||||||
my $backend =
|
use File::Spec;
|
||||||
File::Spec->catfile(
|
use Path::Class;
|
||||||
(File::Spec->splitpath(
|
use Cwd 'realpath';
|
||||||
realpath(File::Spec->catfile( $FindBin::RealBin, $FindBin::RealScript ))
|
use File::Copy 'move';
|
||||||
))[1],
|
|
||||||
'netdisco-backend');
|
|
||||||
|
|
||||||
|
my $me = realpath(File::Spec->catfile($FindBin::RealBin, $FindBin::RealScript));
|
||||||
|
my $uid = (stat($me))[4] || 0;
|
||||||
|
my $home = ($ENV{NETDISCO_HOME} || (getpwuid($uid))[7] || $ENV{HOME});
|
||||||
|
|
||||||
|
my $old_pid = file($home, 'netdisco-daemon.pid');
|
||||||
|
my $new_pid = file($home, 'netdisco-backend.pid');
|
||||||
|
if (-f $old_pid) { move( $old_pid, $new_pid ) }
|
||||||
|
|
||||||
|
my $backend =
|
||||||
|
File::Spec->catfile((File::Spec->splitpath( $me ))[1], 'netdisco-backend');
|
||||||
exec {$backend} 'netdisco-backend', @ARGV;
|
exec {$backend} 'netdisco-backend', @ARGV;
|
||||||
|
|||||||
@@ -3,17 +3,17 @@
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
use File::Spec;
|
|
||||||
use Cwd 'realpath';
|
|
||||||
|
|
||||||
use FindBin;
|
use FindBin;
|
||||||
FindBin::again();
|
FindBin::again();
|
||||||
|
|
||||||
my $backend =
|
use File::Spec;
|
||||||
File::Spec->catfile(
|
use Path::Class;
|
||||||
(File::Spec->splitpath(
|
use Cwd 'realpath';
|
||||||
realpath(File::Spec->catfile( $FindBin::RealBin, $FindBin::RealScript ))
|
|
||||||
))[1],
|
|
||||||
'netdisco-backend-fg');
|
|
||||||
|
|
||||||
|
my $me = realpath(File::Spec->catfile($FindBin::RealBin, $FindBin::RealScript));
|
||||||
|
my $uid = (stat($me))[4] || 0;
|
||||||
|
my $home = ($ENV{NETDISCO_HOME} || (getpwuid($uid))[7] || $ENV{HOME});
|
||||||
|
|
||||||
|
my $backend =
|
||||||
|
File::Spec->catfile((File::Spec->splitpath( $me ))[1], 'netdisco-backend-fg');
|
||||||
exec {$backend} 'netdisco-backend-fg', @ARGV;
|
exec {$backend} 'netdisco-backend-fg', @ARGV;
|
||||||
|
|||||||
Reference in New Issue
Block a user