- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script run on another shell
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
Discussions
Discussions
Forums
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
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
тАО05-05-2009 09:07 AM
тАО05-05-2009 09:07 AM
Script run on another shell
I have a script to start the database whit those lines:
su - sybase -c "/sybase/ASE-12_5/install/startserver -f /sybase/ASE-12_5/install/RUN_SYBASE"
echo "BASE INICIADA"
But.... the messages "BASE INICIADA" appears before base started.
Any idea?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-05-2009 09:15 AM
тАО05-05-2009 09:15 AM
Re: Script run on another shell
Control the shell the script runs with the top line of the script.
#!/bin/ksh
# Whatever you want.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-05-2009 11:20 AM
тАО05-05-2009 11:20 AM
Re: Script run on another shell
"su - sybase -c "/sybase/ASE-12_5/install/startserver -f /sybase/ASE-12_5/install/RUN_SYBASE; echo 'BASE INICIADA'
" but I don't think it will help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-05-2009 10:08 PM
тАО05-05-2009 10:08 PM
Re: Script run on another shell
you can do this to avoid. change the above line to look like this
su - sybase -c "/sybase/ASE-12_5/install/startserver -f /sybase/ASE-12_5/install/RUN_SYBASE" && echo "BASE INICIADA"
i.e if the startserver scripts runs successfully then do the echo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-05-2009 10:27 PM
тАО05-05-2009 10:27 PM
Re: Script run on another shell
Put this in one line with ";" seperator
su - sybase -c "/sybase/ASE-12_5/install/startserver -f /sybase/ASE-12_5/install/RUN_SYBASE";echo "BASE INICIADA"
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-05-2009 10:41 PM
тАО05-05-2009 10:41 PM
Re: Script run on another shell
su - sybase -c "/sybase/ASE-12_5/install/startserver \
-f /sybase/ASE-12_5/install/RUN_SYBASE"; echo "BASE INICIADA"
I don't see how this is any different, than separate su then echo.
I suppose you could do both under that su but that won't be different, other than which shell does the echo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-05-2009 11:09 PM
тАО05-05-2009 11:09 PM
Re: Script run on another shell
If I give command saperater between 2 commands for example #ls;cat abc
cat abc will run after compleated the 1st command right if this is ok then in above also right 1st it will run the su then it will run echo.
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-05-2009 11:49 PM
тАО05-05-2009 11:49 PM
Re: Script run on another shell
There is no difference here between ";" and a newline.
>it will run the su then it will run echo.
Yes, they are done in order but there is another process involved. Since the author said it didn't work, and TTr mentioned "background" the ";" won't help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-06-2009 12:10 AM
тАО05-06-2009 12:10 AM
Re: Script run on another shell
having a program which puts its execution in background requires an extra monitoring to get the exit status or completion of the background part.
At first try
- measure the time until a connection to the DB succeeds
- write a monitor script which ...
- sleeps that time + some factor
- tries to connect to the DB
- reports the availability of the DB
@Suraj: Your statement is incorrect:
>> #ls;cat abc
>> cat abc will run after compleated the 1st command right
>> if this is ok then in above also right
>> 1st it will run the su then it will run echo.
- You'd have to use
ls && cat abc
to do this. Yours would execute the 'cat' whether the 'ls' succeeds or not.
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-06-2009 12:13 AM
тАО05-06-2009 12:13 AM
Re: Script run on another shell
echo "BASE INICIADA" after that process is no longer in the processlist.
But... If for some reason the startup of your database fails, you'll still get the "BASE INICIADA" message as if everything is ok.
You say startserver is a binary. How about RUN_SYBASE, if that is a script, you can create your own version of that script and let it mail you upon completion. You could even check for return codes and report a more meaningfull message.
Regards,
Bart