getting “Suspended (tty output)” on unix script?
I have a script (run as root) that then logs in as a user (oracle) to start up the database on the server. Then logs in as another user (testmgr) to load up the oracle application server on the box.
The script is:
#!/usr/bin/sh -v
su – oracle <<ORAEOF
echo "Starting up the database `date`"
. /m/net/2/oracle/etdb/9.2.0/et_epsilon.env
sqlplus <<DBAEOF
/ as sysdba
startup
DBAEOF
sleep 30
echo "Done with DB"
ORAEOF
su – testmgr <<MGREOF
/m/net/2/oraapps/etcomn/admin/scripts/et_epsilon/adstrtal.sh apps/apps
sleep 60
MGREOF
I get the Suspended (tty output) right after it prints out "Done with DB"
If I type "fg" then it runs properly.
I've run out of ideas… anyone got solutions?
Unix is the original multi-tasking software. Other systems you might have to program things specifically to say “dont wait until this is done to do the next thing” but on Unix you have to specifically tell it if you want “wait for job to finish”
You need to add a “test” for successful return of the job before the one that goes background
Was this answer helpful?
LikeDislike