/bin/sh calls tee which never exits

Brad De Vries devriesbj
Thu Mar 22 05:34:52 PDT 2007


On 3/21/07, James McDonald <james at jamesmcdonald.id.au> wrote:
> I have an issue with a backup script on a Redhat EL3.1 box
>
> Until recently it worked fine but now that a new command has been added
> in the form of:
>
> program_to_execute "program args" 2>redirect_to_file &
>
> I am having to kill the tee -a $LOG process called as shown in the tree
> below to let it complete
>
> It seems that backgrounding the _progres program while it's stderr is
> redirected to a file (autosynch.QPS.err) is causes problems for tee.
>
> Any ideas on what I should be doing to fault find this?
>
> In the past without the startprocautofirm.qpstest script it all worked fine.
>
> The night.sh script is called via cron.
> night.sh
>     \_backup.sh
>         \_ start_all.sh | tee -a $LOG
>             \_ start_test.sh
>                 \_ db_start.sh
>                     \_ start_qpstest.sh
>                            \_startprocautofirm.qpstest
>                                 \_$DLC/bin/_progres \
>                                             -rereadnolock -c 30 -d mdy
> -yy 1920 \
>                                             -Bt 350 -D 100 -mmax 3000
> -nb 200 -s 128 \
>                                             -noshvarfix -pf
> /usr/local/bin/TEST.pf \
>                                             -b -p
> /u4/app/qad/eb2sp9/qps/scheduler/synch/autosynch.p \
>                                             -param userid="QPS"
> 2>autosynch.QPS.err &

James, have you tried redirecting the standard out of _progres
execution?  I'm wondering if tee is going to continue running until
_progres ends because it's trying to capture _progres' stdout.

Also, it's hard to tell, due to line wrapping, if there are the
correct number and placement of the "\" character to hold the line.
Just double-checking.

Brad.



More information about the Linux-users mailing list