From 04a38b3fb6173a7ee5819f346f7764814697c72b Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Tue, 24 Mar 2015 12:49:39 -0400 Subject: [PATCH] LP 1435966: Clark Kent should write lock file after it forks. 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 Signed-off-by: Galen Charlton --- Open-ILS/src/reporter/clark-kent.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Open-ILS/src/reporter/clark-kent.pl b/Open-ILS/src/reporter/clark-kent.pl index 2e9bbd9899..8893fc5ca6 100755 --- a/Open-ILS/src/reporter/clark-kent.pl +++ b/Open-ILS/src/reporter/clark-kent.pl @@ -91,10 +91,10 @@ my $data_dsn = "dbi:" . $data_db{db_driver} . ":dbname=" . $data_db{db_name} 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"); } -- 2.43.2