Lines Matching refs:pid
286 my %serverpidfile;# all server pid file names, identified by server id
376 my $pid = $_[0];
377 if(not defined $pid || $pid <= 0) {
380 my $rc = waitpid($pid, &WNOHANG);
381 return ($rc == $pid)?1:0;
413 # Ugly hack but ssh client and gnutls-serv don't support pid files
418 logmsg "startnew: $pidfile faked with pid=$child\n" if($verbose);
421 logmsg "startnew: failed to write fake $pidfile with pid=$child\n";
437 # if $pid2 is valid, then make sure this pid is alive, as
676 # we must prepend a space since $pidlist may already contain a pid
684 # cleanup server pid files
688 my $pid = processexists($pidfile);
689 if($pid > 0) {
691 killpid($verbose, $pid);
706 my $pid = 0;
763 $pid = 0+$1;
774 return $pid;
786 my $pid = 0;
819 # this is our test server with a known pid!
820 $pid = 0+$1;
824 if($pid <= 0 && @data && $data[0]) {
838 return $pid;
850 my $pid = 0;
900 $pid = 0+$1;
911 return $pid;
916 # the pid from the file and returning it if a process with that pid is
923 my $pid = 0;
925 $pid=0+<FILE>;
928 if($pid > 0) {
929 # if we have a pid it is actually our ssh server,
931 if(!pidexists($pid)) {
933 checkdied($pid);
935 $pid = -1;
938 return $pid;
988 my $pid = 0;
1039 $pid=0+<FILE>;
1041 if($pid > 0) {
1042 # if we have a pid it is actually our httptls server,
1044 if(!pidexists($pid)) {
1046 checkdied($pid);
1048 $pid = -1;
1051 return $pid;
1062 return $pid;
1072 my $pid = 0;
1074 $pid=0+<FILE>;
1077 if($pid > 0) {
1078 # if we have a pid it is actually our socks server,
1080 if(!pidexists($pid)) {
1082 checkdied($pid);
1084 $pid = -1;
1087 return $pid;
1121 my $pid;
1126 $pid = &$fun($proto, $ipvnum, $idnum, $ip, $port);
1128 if($pid > 0) {
1131 elsif($pid < 0) {
1137 return $pid;
1150 my $pid = &$fun($proto, $ipvnum, $idnum, $ip, $port);
1153 if($pid > 0) {
1203 my $pid = processexists($pidfile);
1204 if($pid > 0) {
1205 stopserver($server, "$pid");
1280 my $pid = processexists($pidfile);
1281 if($pid > 0) {
1282 stopserver($server, "$pid");
1356 my $pid = processexists($pidfile);
1357 if($pid > 0) {
1358 stopserver($server, "$pid");
1398 # Here pid3 is actually the pid returned by the unsecure-http server.
1440 my $pid = processexists($pidfile);
1441 if($pid > 0) {
1442 stopserver($server, "$pid");
1535 my $pid = processexists($pidfile);
1536 if($pid > 0) {
1537 stopserver($server, "$pid");
1613 my $pid = processexists($pidfile);
1614 if($pid > 0) {
1615 stopserver($server, "$pid");
1655 # Here pid3 is actually the pid returned by the unsecure-ftp server.
1700 my $pid = processexists($pidfile);
1701 if($pid > 0) {
1702 stopserver($server, "$pid");
1781 my $pid = processexists($pidfile);
1782 if($pid > 0) {
1783 stopserver($server, "$pid");
1856 my $pid = processexists($pidfile);
1857 if($pid > 0) {
1858 stopserver($server, "$pid");
1890 # and gives us the opportunity of recovering the pid from the pidfile, when
1891 # this verification succeeds the recovered pid is assigned to pid2.
1896 # failed to fetch server pid. Kill the server and return failure
1954 my $pid = processexists($pidfile);
1955 if($pid > 0) {
1956 stopserver($server, "$pid");
2050 # Ugly hack but ssh doesn't support pid files. PID is from fake pidfile.
3553 # cleanup server pid files
3557 my $pid = processexists($pidfile);
3558 if($pid > 0) {
3560 killpid($verbose, $pid);
3987 foreach my $pid (split(' ', $pids)) {
3988 if($pid != $prev) {
3989 logmsg sprintf("* kill pid for %s => %d\n",
3990 $server, $pid);
3991 $prev = $pid;
4002 # cleanup all server pid files
4006 my $pid = processexists($pidfile);
4007 if($pid > 0) {
4009 killpid($verbose, $pid);
4022 my ($pid, $pid2);
4042 ($pid, $pid2) = runpingpongserver($what, "", $verbose);
4043 if($pid <= 0) {
4046 printf ("* pid $what => %d %d\n", $pid, $pid2) if($verbose);
4047 $run{$what}="$pid $pid2";
4056 ($pid, $pid2) = runpingpongserver("ftp", "2", $verbose);
4057 if($pid <= 0) {
4060 printf ("* pid ftp2 => %d %d\n", $pid, $pid2) if($verbose);
4061 $run{'ftp2'}="$pid $pid2";
4070 ($pid, $pid2) = runpingpongserver("ftp", "", $verbose, "ipv6");
4071 if($pid <= 0) {
4074 logmsg sprintf("* pid ftp-ipv6 => %d %d\n", $pid,
4076 $run{'ftp-ipv6'}="$pid $pid2";
4085 ($pid, $pid2) = runhttpserver("gopher", $verbose, 0,
4087 if($pid <= 0) {
4090 logmsg sprintf ("* pid gopher => %d %d\n", $pid, $pid2)
4092 $run{'gopher'}="$pid $pid2";
4102 ($pid, $pid2) = runhttpserver("gopher", $verbose, "ipv6",
4104 if($pid <= 0) {
4107 logmsg sprintf("* pid gopher-ipv6 => %d %d\n", $pid,
4109 $run{'gopher-ipv6'}="$pid $pid2";
4118 ($pid, $pid2) = runhttpserver("http", $verbose, 0,
4120 if($pid <= 0) {
4123 logmsg sprintf ("* pid http => %d %d\n", $pid, $pid2)
4125 $run{'http'}="$pid $pid2";
4135 ($pid, $pid2) = runhttpserver("http", $verbose, "proxy",
4137 if($pid <= 0) {
4140 logmsg sprintf ("* pid http-proxy => %d %d\n", $pid, $pid2)
4142 $run{'http-proxy'}="$pid $pid2";
4151 ($pid, $pid2) = runhttpserver("http", $verbose, "ipv6",
4153 if($pid <= 0) {
4156 logmsg sprintf("* pid http-ipv6 => %d %d\n", $pid, $pid2)
4158 $run{'http-ipv6'}="$pid $pid2";
4168 ($pid, $pid2) = runhttpserver("http", $verbose, "pipe",
4170 if($pid <= 0) {
4173 logmsg sprintf ("* pid http-pipe => %d %d\n", $pid, $pid2)
4175 $run{'http-pipe'}="$pid $pid2";
4184 ($pid, $pid2) = runrtspserver($verbose);
4185 if($pid <= 0) {
4188 printf ("* pid rtsp => %d %d\n", $pid, $pid2) if($verbose);
4189 $run{'rtsp'}="$pid $pid2";
4198 ($pid, $pid2) = runrtspserver($verbose, "IPv6");
4199 if($pid <= 0) {
4202 logmsg sprintf("* pid rtsp-ipv6 => %d %d\n", $pid, $pid2)
4204 $run{'rtsp-ipv6'}="$pid $pid2";
4225 ($pid, $pid2) = runpingpongserver("ftp", "", $verbose);
4226 if($pid <= 0) {
4229 printf ("* pid ftp => %d %d\n", $pid, $pid2) if($verbose);
4230 $run{'ftp'}="$pid $pid2";
4233 ($pid, $pid2) = runftpsserver($verbose, "", $certfile);
4234 if($pid <= 0) {
4237 logmsg sprintf("* pid ftps => %d %d\n", $pid, $pid2)
4239 $run{'ftps'}="$pid $pid2";
4263 ($pid, $pid2) = runhttpserver("http", $verbose, 0,
4265 if($pid <= 0) {
4268 printf ("* pid http => %d %d\n", $pid, $pid2) if($verbose);
4269 $run{'http'}="$pid $pid2";
4272 ($pid, $pid2) = runhttpsserver($verbose, "", $certfile);
4273 if($pid <= 0) {
4276 logmsg sprintf("* pid https => %d %d\n", $pid, $pid2)
4278 $run{'https'}="$pid $pid2";
4291 ($pid, $pid2) = runhttptlsserver($verbose, "IPv4");
4292 if($pid <= 0) {
4295 logmsg sprintf("* pid httptls => %d %d\n", $pid, $pid2)
4297 $run{'httptls'}="$pid $pid2";
4310 ($pid, $pid2) = runhttptlsserver($verbose, "IPv6");
4311 if($pid <= 0) {
4314 logmsg sprintf("* pid httptls-ipv6 => %d %d\n", $pid, $pid2)
4316 $run{'httptls-ipv6'}="$pid $pid2";
4325 ($pid, $pid2) = runtftpserver("", $verbose);
4326 if($pid <= 0) {
4329 printf ("* pid tftp => %d %d\n", $pid, $pid2) if($verbose);
4330 $run{'tftp'}="$pid $pid2";
4339 ($pid, $pid2) = runtftpserver("", $verbose, "IPv6");
4340 if($pid <= 0) {
4343 printf("* pid tftp-ipv6 => %d %d\n", $pid, $pid2) if($verbose);
4344 $run{'tftp-ipv6'}="$pid $pid2";
4349 ($pid, $pid2) = runsshserver("", $verbose);
4350 if($pid <= 0) {
4353 printf ("* pid ssh => %d %d\n", $pid, $pid2) if($verbose);
4354 $run{'ssh'}="$pid $pid2";
4358 ($pid, $pid2) = runsocksserver("", $verbose);
4359 if($pid <= 0) {
4362 printf ("* pid socks => %d %d\n", $pid, $pid2) if($verbose);
4363 $run{'socks'}="$pid $pid2";