aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Bachelier <laurent@bachelier.name>2010-06-23 11:07:27 +0200
committerLaurent Bachelier <laurent@bachelier.name>2010-06-23 11:07:27 +0200
commitb9c43f5edaa1a51b0565780042c5a48a275daad3 (patch)
tree78bfe18fba9cb11b9e7bf51f92904620a4652455
parentValidate PID (diff)
downloadsymfttpd-b9c43f5edaa1a51b0565780042c5a48a275daad3.tar.xz
Fixed rare case when --kill would not work and spawn would continue
-rwxr-xr-xspawn8
1 files changed, 3 insertions, 5 deletions
diff --git a/spawn b/spawn
index 9cb1f2b..fa9d1b1 100755
--- a/spawn
+++ b/spawn
@@ -29,6 +29,7 @@ if (Argument::get('K', 'kill', false))
if (file_exists($options['pidfile']))
{
$pid = intval(trim(file_get_contents($options['pidfile'])));
+ unlink($options['pidfile']);
if ($pid)
{
posix_kill($pid, SIGTERM);
@@ -36,11 +37,8 @@ if (Argument::get('K', 'kill', false))
exit(0);
}
}
- else
- {
- echo "No running process found\n";
- exit(1);
- }
+ echo "No running process found\n";
+ exit(1);
}
FileTools::mkdirs($options['config_dir']);