[Barrelfish-users] FYI, a Fix for /tools/scc/watchall.sh

Shi Jinghao (史经浩) jhshi at cs.hku.hk
Mon May 7 12:44:32 CEST 2012


On Mon, May 7, 2012 at 5:40 PM, Simon Peter <speter at inf.ethz.ch> wrote:

>         - trap "pkill -P $$" SIGINT can not kill previous cat process
>>        properly,
>>    Can you point out why it is failing? It seems to be working here.
>>    Unfortunately, your fix will end up killing any cat process in the
>>    system, which is not desirable.
>> My understanding is that the script's process id ($$) is not the same on
>> each run. So the second run of the script fail to kill the cat processes
>> created by the first run of the script. Is this reasonable?
>>
>
> You shouldn't be starting the script twice at the same time. AFAIK, the
> serial console cannot be opened multiple times. The next time you start the
> script, the $$ should point to the right process, no?


I suddenly realized that I mis-understood the trap command. It's used to
kill all the processes created by this script when user hit crtl+c to
terminate, right? What a good script trick that I didn't know before.
Please forgive my poor script knowledge. Hope this didn't bother you :-)

>
>
>         - "cat /dev/crbif0rb0c${i}ttyS0 | grep . --line-buffered &" in
>>        the for
>>        loop can not display the
>>        outputs properly: only empty lines are printed.
>>    Thanks for fixing this one. I'm not sure why it prints only empty
>>    lines in your case, though I see no problem applying your fix.
>> I don't know why it fails here either. I tried stackoverflow[1][2] by
>> get no useful answer. Personally, I suspect that there are some control
>> bytes in the UART stream that fools grep, but I'm not sure...
>>
>
> In fact, it prints only non-empty lines. And it should also have an -a
> added, in case non-printable characters are being sent. I've fixed this.
>
> Simon
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.inf.ethz.ch/pipermail/barrelfish-users/attachments/20120507/145c0aa5/attachment.html 


More information about the Barrelfish-users mailing list