Lines Matching refs:pid
97 my $pid = 0;
100 $pid = 0 + <$pidfh>;
102 $pid = 0 if($pid < 0);
104 return $pid;
114 my $pid = $_[0];
116 if($pid > 0) {
118 if ($pid > 65536 && os_is_win()) {
119 $pid -= 65536;
121 my $filter = "PID eq $pid";
123 if(index($result, "$pid") != -1) {
124 return -$pid;
131 if(kill(0, $pid)) {
132 return $pid;
143 my $pid = $_[0];
145 if($pid > 0) {
147 if ($pid > 65536 && os_is_win()) {
148 $pid -= 65536;
150 my $filter = "PID eq $pid";
152 if(index($result, "$pid") != -1) {
160 kill("TERM", $pid);
168 my $pid = $_[0];
170 if($pid > 0) {
172 if ($pid > 65536 && os_is_win()) {
173 $pid -= 65536;
175 my $filter = "PID eq $pid";
177 if(index($result, "$pid") != -1) {
180 system("tskill $pid >nul 2>&1");
187 kill("KILL", $pid);
195 my $pid = $_[0];
199 if ($pid > 65536 && os_is_win()) {
201 return pidexists($pid)?0:$pid;
203 while(pidexists($pid)) {
206 return $pid;
210 return waitpid($pid, $flags);
226 my $pid = pidfromfile($pidfile);
228 if($pid > 0) {
230 if(pidexists($pid)) {
231 return $pid;
235 unlink($pidfile) if($pid == pidfromfile($pidfile));
237 pidwait($pid, &WNOHANG);
239 return -$pid;
275 my $pid = $1;
276 if($pid > 0) {
277 if(pidexists($pid)) {
278 print("RUN: Process with pid $pid signalled to die\n")
280 pidterm($pid);
281 push @signalled, $pid;
284 print("RUN: Process with pid $pid already dead\n")
287 pidwait($pid, &WNOHANG);
288 push @reapchild, $pid;
299 my $pid = $signalled[$i];
300 if(!pidexists($pid)) {
301 print("RUN: Process with pid $pid gracefully died\n")
305 pidwait($pid, &WNOHANG);
306 push @reapchild, $pid;
316 foreach my $pid (@signalled) {
317 if($pid > 0) {
318 print("RUN: Process with pid $pid forced to die with SIGKILL\n")
320 pidkill($pid);
322 pidwait($pid, &WNOHANG);
323 push @reapchild, $pid;
330 foreach my $pid (@reapchild) {
331 if($pid > 0) {
332 pidwait($pid, 0);
345 my $pid;
356 $pid = processexists($pidfile);
357 if($pid > 0) {
359 ($proto eq 'ftp')?'ctrl':'filt', $pid) if($verbose);
360 pidkill($pid);
361 pidwait($pid, 0);
370 $pid = processexists($pidfile);
371 if($pid > 0) {
373 $pid) if($verbose);
374 pidkill($pid);
375 pidwait($pid, 0);