On Wed, Sep 15, 2010 at 9:17 AM, Sergey Naumov <[email protected]> wrote:
> Hello.
>
> I have tried to execute following command on busybox's ash:
> # ps | grep `fuser /dev/ttyS0`
>
> On host's (Debian 5.0.0) ash it results in normal output:
> # ash -c "ps | grep `fuser /dev/console`"
> 2002 root /usr/sbin/ledstats

It's likely caused by the speed of the machine: ps completes before
fuser can see it.

If you replace ps with longer-living process, you will see two pids:

# busybox fuser /dev/pts/3
19932
# true | busybox fuser /dev/pts/3
19932
# sleep 1 | busybox fuser /dev/pts/3
13947 19932

> but on embedded system it prints
> # fuser /dev/ttyS0
> 902
> # ps -o pid,comm | grep 902
> 902 sh
> # ps | grep `fuser /dev/ttyS0`
> grep: 3809: No such file or directory

Different (slower) system -> different race outcome.
-- 
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to