- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: wait usage
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2008 07:56 AM
01-10-2008 07:56 AM
I am stopping an SAP application via a shutdown script, and then I want to unmount its filesystems.
I want to make sure the application shutdown script completes successfully so that I won't have any issues unmounting the filesystems.
How can I use the "wait" command for this purpose?
I've always used "sleep" previously but wait seems to be smarter.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2008 08:01 AM
01-10-2008 08:01 AM
Solutionwait `cat /tmp/PIDfile`
By the way, wait only works on background processes so this may not be exactly what you wanted.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2008 08:06 AM
01-10-2008 08:06 AM
Re: wait usage
wait can wait for a background process exit.
so if you do
unmount /myfilesys &
echo unmounting
wait
echo umount result$?
or
unmount /myfilesys &
umntpid=$!
echo unmounting
wait $umntpid
echo unmount result $?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2008 08:09 AM
01-10-2008 08:09 AM
Re: wait usage
If you are simply running syhcnronous tasks:
#/usr/bin/sh
/myshutdown_thing
[ $? -eq 0 ] && echo "success!" || { echo "I failed!"; exit 1; }
echo "now unmounting"
...
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2008 08:35 AM
01-10-2008 08:35 AM
Re: wait usage
the shutdown command
and then the umount
I presume the above about exit code still applies.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2008 09:53 AM
01-10-2008 09:53 AM
Re: wait usage
> I am not sure what you mean by synchronous.
Yes, one process after the other, seriallly, rather than in parallel. For example:
# cat ./parallel
#!/usr/bin/sh
( sleep 20; date ) &
T1=$!
echo "task-1 pid=${T1} started"
( sleep 10; date ) &
T2=$!
echo "task-2 pid=${T2} started"
wait ${T1}
wait #{T2}
echo "...finally..."
Regards!
...JRF...