Peter Ennis wrote:
Brandon Peirce <brandon_peirce <at> hotmail.com> writes:
> Did you try running the test in the foreground, without the script and
> without
> too many other things running at the same time?
>
The tests work normally without
scripting.
Compiling the complete LFS it again stopped at the
same point. I use the following command command style for
backgrounding the script:
Ref:
http://www.askdavetaylor.com/my_background_jobs_in_linux_have_become_invisible.html
$ nohup rsync args > /tmp/rsync.log &
Then, if you want to watch it working, simply use:
$ tail -f /tmp/rsync.log
When I interrupt the script with Ctr-C the following is
the output:
run-posixpat
run-precedence
run-printf
run-quote
run-read
warning: please do not consider output differing only in the amount of
warning: white space to be an error.
40c40
< ./read2.sub: line 13: /dev/tty: No such device or address
---
> ./read2.sub: line 13: read: -3: invalid timeout specification
62c62
< 0 0 0
---
> 0 0 0
The file run-read is this:
==========================
echo "warning: please do not consider output differing only in the amount
of" >&2
echo "warning: white space to be an error." >&2
${THIS_SH} ./read.tests > /tmp/xx 2>&1
diff /tmp/xx read.right && rm -f /tmp/xx
The file read.tests has this:
=============================
# test read -t timeout behavior
${THIS_SH} ./read2.sub
and read2.sub is:
=================
a=4
read -t 2 a < /dev/tty
echo $?
echo $a
sleep 5 | read -t 1 a
echo $?
echo $a
read -t -3 a < /dev/tty
echo $?
echo $a
# the above should all time out
echo abcde | {
read -t 2 a
echo $a
}
I have a master script that runs the bash script and also
creates the log files. The error output states:
./read2.sub: line 13: /dev/tty: No such device or address
and read2.sub is looking for input from /dev/tty
which does exist.
ISTM that the combination of commands is a problem:
backgrounding with &,
using 2>&1 in the script for log generation,
the run-read tests using a variety of
redirections
OR
The read2.sub test says:
# the above should all time out
and the timeout error is lost/not trapped in
the redirection confusion.
One idea I have is to put set -e and set +e
around this test.
Any other ideas?
Hmmm, I read something somewhere recently about tests not running properly
in the backround but I don't remember encountering any problems that I could
specifically track down to that....
One thing I know is that backgrounding jobs can do special things with your
stdin/stdout and controlling terminal -- like attaching them to /dev/null if
they
are not explicitly redirected, or something like that IIRC.
I have two different sets of scripts with which I have successfully compiled
Bash in the last weeks--one on my host and one in a dynamically built
chroot.
I'm running them both in the background now (just with the shell '&', not
nohup) and guess what...
My loadavg dropped to near zero , they were both still in the test suite
phase.
Press enter on each respective terminal and get
on the host:
[1]+ Stopped ./pkgbld clean catalog
in the chroot (using ash shell):
[1] 17236 Stopped (tty input) ./build bash
In both cases, if I resume the jobs, the test suite runs to completion
without
any failures (except a known one I have because of broken utf-8 support)!
So I guess the answer is not to run Bash test suite in the background!
Just leave your script running on another terminal. If you must run it in
the
background you can still redirect the output and use tail -f, but don't use
nohup. When you detect that it's hanging in the bash test suite, just
resume
it in the foreground with fg, for at minute or two till it passes those
tests,
then suspend it again ("Z) and resume it in the background with bg.
Then you can disown it with disown -h which is similar to nohup, meaning
you can the log out and the job will still run.
Even better is to use GNU Screen (ftp://ftp.gnu.org/gnu/screen
or your favorite mirror). With that, you can run your script in the
foreground
in a dedicated "screen window" and you can even detach from the screen
session and log out and it continues to run as if in the foreground. Just
don't forget that it's running and reboot the host!
Brandon
--
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page