Skip to content

Commit

Permalink
LP 1435966: Clark Kent should write lock file after it forks.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jason Stephenson authored and gmcharlt committed Mar 24, 2015
1 parent 2acd1c2 commit 04a38b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Open-ILS/src/reporter/clark-kent.pl
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@
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");
}


Expand Down

0 comments on commit 04a38b3

Please sign in to comment.