an alternative to fuser in

George Boudreau georgeb at
Wed Jun 28 16:12:50 PDT 2006

Dan Nicholson wrote:
> On 6/28/06, George Boudreau <georgeb at> wrote:
>>   # note.. DO NOT try and trace the variable makePID..
>>   # it changes the fuser text
>> makePID=$(fuser -v . 2>&1 | grep make)
>> makePID=$(echo $makePID | cut -d" " -f2)
>> write_or_exit() {
>>      # make has been killed or failed or run to completion, leave
>>    [[ ! -e /proc/$makePID ]] && echo -n "${CURSOR_ON}" && exit
>>      # Target build complete, leave.
>>    [[ -f ${TARGET} ]] && echo -n "${CURSOR_ON}" && exit
>>      # It is safe to write to the screen
>>    echo -n "$1"
>> }
> Yes!  Why didn't I think of that before?  It's a little bit of a hack
> since that pid could be reused, but the chances of that happening in
> between write_or_exit pollings is obviously miniscule.  Way better.
   Actually the pid of make cannot be reused until 'make' terminates at 
which point the progress_bar script dies of loneliness (no one to play 
with). The progress_bar script normally exits when a target is 
successfully built and the makefile touches nnn-target. The other test 
is there to catch target build failures or makefile abnormal termination.

> I'll check it out. Incidentally, I want to rerun the glibc and gcc
> testsuites.  I got some timeouts for some unknown reason before :).
> If I just want to rebuild those targets, do I simply rm 066-glibc and
> 069-gcc and ./lfs -M?  I don't mind overwriting the installed files
> and the build has already run to completion.  I think make will check
> that all dependencies of the targets are built, right?
   Yes.. that will work as long as there are no logical links created.. 
i.e.  ln -s xxx yyy then the build will fail. Look at the build scripts 
and set any ln -s to ln -sf .. Be aware that the search path conflicts 
with previously installed gcc glibc components.

   Actually you only need to enter the jhalfs directory and do <sudo 
make> once you have eliminated 066-glibc and 069-gcc ..
> -- 
> Dan

More information about the alfs-discuss mailing list