Rearrange the code in clark-kent.pl so that the lock/pid file is
opened and written to after the reporter daemonizes itself. This
way, the pid in the file can actually be used to stop the running
reporter daemon.
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
my ($dbh,$running,$sth,@reports,$run, $current_time);
if ($daemon) {
+ daemonize("Clark Kent, waiting for trouble");
open(F, ">$lockfile") or die "Cannot write lockfile '$lockfile'";
print F $$;
close F;
- daemonize("Clark Kent, waiting for trouble");
}