Hi,
We'v on our LXC container, a php script wich exec some "ps aux | grep something" for check
if a process is running or not.
I'v noticed that it hang on the "ps" command, wich is not avaiable to strace too.
If I kill the grep command, nothing change, if I try to kill the "ps" command, it mark the process as "Dead".
With strace it hangs, as you could see there:
Any suggestion for fix it? For now, i'v added a "timeout" for the ps, hoping that it did not let the process block.
Thank you so much
Regards[/S][/S]
We'v on our LXC container, a php script wich exec some "ps aux | grep something" for check
if a process is running or not.
I'v noticed that it hang on the "ps" command, wich is not avaiable to strace too.
root 8708 0.0 0.0 4408 768 ? Ss Mar04 0:00 | \_ /bin/sh -c /usr/bin/php /var/www/cron/syncLauncher.php >> /dev/null 2>&1
root 8709 0.0 0.0 225360 29876 ? S Mar04 0:00 | \_ /usr/bin/php /var/www/cron/syncLauncher.php
root 8727 0.0 0.0 4408 684 ? S Mar04 0:00 | \_ sh -c ps aux | grep "syncLauncher.php" | grep -v grep | grep -v /bin/sh | wc -l
root 8729 0.0 0.0 8284 1352 ? S Mar04 0:00 | \_ ps aux
root 8730 0.0 0.0 8112 2124 ? S Mar04 0:00 | \_ grep syncLauncher.php
root 8731 0.0 0.0 8112 2056 ? S Mar04 0:00 | \_ grep -v grep
root 8732 0.0 0.0 8112 2168 ? S Mar04 0:00 | \_ grep -v /bin/sh
root 8733 0.0 0.0 5896 1684 ? S Mar04 0:00 | \_ wc -l
--
root 6508 0.0 0.0 4408 772 ? Ss Mar04 0:00 | \_ /bin/sh -c /usr/bin/php /var/www/cron/syncLauncher.php >> /dev/null 2>&1
root 6509 0.0 0.0 225356 30052 ? S Mar04 0:00 | \_ /usr/bin/php /var/www/cron/syncLauncher.php
root 6889 0.0 0.0 4408 692 ? S Mar04 0:00 | \_ sh -c ps aux | grep -cw "[ S]yncFilesByIP.php 1.2.3.4"
root 6890 0.0 0.0 8284 1356 ? S Mar04 0:00 | \_ ps aux
root 6891 0.0 0.0 8112 2132 ? S Mar04 0:00 | \_ grep -cw [ S]yncFilesByIP.php 1.2.3.4[/S][/S]
root 8709 0.0 0.0 225360 29876 ? S Mar04 0:00 | \_ /usr/bin/php /var/www/cron/syncLauncher.php
root 8727 0.0 0.0 4408 684 ? S Mar04 0:00 | \_ sh -c ps aux | grep "syncLauncher.php" | grep -v grep | grep -v /bin/sh | wc -l
root 8729 0.0 0.0 8284 1352 ? S Mar04 0:00 | \_ ps aux
root 8730 0.0 0.0 8112 2124 ? S Mar04 0:00 | \_ grep syncLauncher.php
root 8731 0.0 0.0 8112 2056 ? S Mar04 0:00 | \_ grep -v grep
root 8732 0.0 0.0 8112 2168 ? S Mar04 0:00 | \_ grep -v /bin/sh
root 8733 0.0 0.0 5896 1684 ? S Mar04 0:00 | \_ wc -l
--
root 6508 0.0 0.0 4408 772 ? Ss Mar04 0:00 | \_ /bin/sh -c /usr/bin/php /var/www/cron/syncLauncher.php >> /dev/null 2>&1
root 6509 0.0 0.0 225356 30052 ? S Mar04 0:00 | \_ /usr/bin/php /var/www/cron/syncLauncher.php
root 6889 0.0 0.0 4408 692 ? S Mar04 0:00 | \_ sh -c ps aux | grep -cw "[ S]yncFilesByIP.php 1.2.3.4"
root 6890 0.0 0.0 8284 1356 ? S Mar04 0:00 | \_ ps aux
root 6891 0.0 0.0 8112 2132 ? S Mar04 0:00 | \_ grep -cw [ S]yncFilesByIP.php 1.2.3.4[/S][/S]
With strace it hangs, as you could see there:
root@vmsrv02:~# strace -f -e verbose=all -v -p 6891
Process 6891 attached
read(0, ^CProcess 6891 detached
<detached ...>
Process 6891 attached
read(0, ^CProcess 6891 detached
<detached ...>
root@vmsrv02:~# strace -f -e verbose=all -v -p 6890
Process 6890 attached
^C^C^C^C^C^C <-- It did not detach.
Process 6890 attached
^C^C^C^C^C^C <-- It did not detach.
Any suggestion for fix it? For now, i'v added a "timeout" for the ps, hoping that it did not let the process block.
Thank you so much
Regards[/S][/S]