So you're having a problem with the redirection of the & output instead
of the while loop output.
How about this from the LDP about reassigning STDOUT.
exec 6>&1 # Link file descriptor #6 with stdout.
# Saves stdout.
while true; do
dd if=/scratch/dummy of=/scratch/junk bs=64k >/dev/null 2>&1
done >/dev/null 2>&1 &
exec 0<&6 6<&-
# Now restore stdin from fd #6, where it had been saved,
#+ and close fd #6 ( 6<&- ) to free it for other processes to use.
# <&6 6<&- also works.
I wasn't able to reproduce the result mind you.
I would run this script above (without the execs), it would exit
immediately, and then I would go and kill it and I recieved no kill
Perhaps a better test case would set me straight, this does however
generate a lot of disk I/O.
Greg Freemyer wrote:
> I have the very basics of a new test almost working. I'm assuming it will be
> One big problem I have is that I start a background infinite loop of dd's to
> generate some i/o load.
> while true; do
> dd if=/scratch/dummy of=/scratch/junk bs=64k >/dev/null 2>&1
> rm /scratch/junk
> done >/dev/null 2>&1 &