Track PID

This commit is contained in:
John Mertz 2022-09-17 15:17:28 -04:00
parent 2559d13d38
commit d8ae0c1c48
1 changed files with 7 additions and 0 deletions

View File

@ -13,6 +13,13 @@ my $lat_lon = fetch_lat_lon($location);
my $pid = fork;
unless ($pid) {
open(my $fh, ">", $ENV{HOME}."/.spool/gammastep.pid");
print $fh $$;
close($fh);
open($fh, ">", $ENV{HOME}."/.spool/gammastep.status");
print $fh 1;
close($fh);
open STDIN, '/dev/null';
open STDOUT, '>>/dev/null';
open STDERR, '>>/dev/null';