background - "stopped" how to kill!

Rick Stevens ricks at alldigital.com
Fri Jun 6 20:17:04 UTC 2014


On 06/06/2014 11:08 AM, bruce issued this missive:
> Hi Russell,
>
> the test code is::
> #!/usr/bin/php
> <?php
> /*
>
>      parent.php
>
>      /ycrawl/dcrawl/run/yolo-master/parent.php
>
>      test to see about the "&" background process
> */
>
> print "start \n";
> sleep(5);
>
> print "stop \n";
>
> $t=posix_getpid();
> //system("kill -9 ".$t);
> posix_kill($t, 9);
> exit();
>
> ?>
>
>
> As you can see, there's nothing special about this. And yeah, when
> runs as foo.php & <<  it shows up in the procTBL as "T" in the status.
>
> There are no filedescriptors in the test.

It has at least one descriptor, stdout. You're having it print two
lines. If you background it, it's going to hang trying to print out to
stdout.

Try "php foo.php >/dev/null 2>&1 &" to make it write stdout and stderr
to /dev/null and see if that works.
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer, AllDigital    ricks at alldigital.com -
- AIM/Skype: therps2        ICQ: 22643734            Yahoo: origrps2 -
-                                                                    -
- Grabel's Law: 2 is not equal to 3--not even for large values of 2. -
----------------------------------------------------------------------


More information about the users mailing list