Lines Matching refs:pid
78 my $pid = 0;
81 $pid = 0 + <PIDFH>;
83 $pid = 0 unless($pid > 0);
85 return $pid;
95 my $pid = $_[0];
97 if($pid > 0) {
99 if ($pid > 65536 && os_is_win()) {
100 $pid -= 65536;
102 my $filter = "PID eq $pid";
104 if(index($result, "$pid") != -1) {
105 return -$pid;
112 if(kill(0, $pid)) {
113 return $pid;
124 my $pid = $_[0];
126 if($pid > 0) {
128 if ($pid > 65536 && os_is_win()) {
129 $pid -= 65536;
131 my $filter = "PID eq $pid";
133 if(index($result, "$pid") != -1) {
141 kill("TERM", $pid);
149 my $pid = $_[0];
151 if($pid > 0) {
153 if ($pid > 65536 && os_is_win()) {
154 $pid -= 65536;
156 my $filter = "PID eq $pid";
158 if(index($result, "$pid") != -1) {
161 system("tskill $pid >nul 2>&1");
168 kill("KILL", $pid);
176 my $pid = $_[0];
180 if ($pid > 65536 && os_is_win()) {
182 return pidexists($pid)?0:$pid;
184 while(pidexists($pid)) {
187 return $pid;
191 return waitpid($pid, $flags);
207 my $pid = pidfromfile($pidfile);
209 if($pid > 0) {
211 if(pidexists($pid)) {
212 return $pid;
216 unlink($pidfile) if($pid == pidfromfile($pidfile));
218 pidwait($pid, &WNOHANG);
220 return -$pid;
256 my $pid = $1;
257 if($pid > 0) {
258 if(pidexists($pid)) {
259 print("RUN: Process with pid $pid signalled to die\n")
261 pidterm($pid);
262 push @signalled, $pid;
265 print("RUN: Process with pid $pid already dead\n")
268 pidwait($pid, &WNOHANG);
269 push @reapchild, $pid;
280 my $pid = $signalled[$i];
281 if(!pidexists($pid)) {
282 print("RUN: Process with pid $pid gracefully died\n")
286 pidwait($pid, &WNOHANG);
287 push @reapchild, $pid;
297 foreach my $pid (@signalled) {
298 if($pid > 0) {
299 print("RUN: Process with pid $pid forced to die with SIGKILL\n")
301 pidkill($pid);
303 pidwait($pid, &WNOHANG);
304 push @reapchild, $pid;
311 foreach my $pid (@reapchild) {
312 if($pid > 0) {
313 pidwait($pid, 0);
326 my $pid;
337 $pid = processexists($pidfile);
338 if($pid > 0) {
340 ($proto eq 'ftp')?'ctrl':'filt', $pid) if($verbose);
341 pidkill($pid);
342 pidwait($pid, 0);
351 $pid = processexists($pidfile);
352 if($pid > 0) {
354 $pid) if($verbose);
355 pidkill($pid);
356 pidwait($pid, 0);