- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Question about setting a program to startup automa...
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
02-06-2003 09:54 AM
02-06-2003 09:54 AM
Question about setting a program to startup automatically
I have a question about starting up an application automatically. I am fully aware that when you want to start up an application at boot time that you have to have a corresponding /etc/rc.config.d file for the app you want to start and set it to 1.
With that being said, i am attaching a script which is the S777netbackup startup script from my system's /sbin/init.d directory and what I want to know is how i can input a section into this script which will check a variable at startup time that the file exist in /etc/rc.config.d for startup of this application automatically.
example:
/etc/rc.config.d/netbackup
RUN_NETBACKUP=1
If I have this file in place in the rc.config.d directory how can I put something into the S777netbackup script that will allow it to read this other file in rc.config.d and startup the application automatically.
Sorry for the long post.
fg.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2003 09:59 AM
02-06-2003 09:59 AM
Re: Question about setting a program to startup automatically
I am not writing the script portion as you know how to write it.
You just need to put a check in your netbackup init.d script to see if RUN_NETBACKUP in rc.config.d/netbackup has been set to 1. If so, run your startup|shutdown command otherwise exit.
Take an example script (like cron) and see how it has been setup and you will get a good idea.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2003 10:05 AM
02-06-2003 10:05 AM
Re: Question about setting a program to startup automatically
It should be simple to add more or less the same commands into the top of your script, to basically:
if exists,
then
if run=1
then continue
else exit
else continue
continue...
Are you looking for an actual working version of your script back that does this? I don't have time right now, but maybe later, let me know if this helps, or if that's what you are looking for.
Regards, --bmr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2003 10:34 AM
02-06-2003 10:34 AM
Re: Question about setting a program to startup automatically
if [ -f /etc/rc.config ] ; then
. /etc/rc.config
else
echo "ERROR: /etc/rc.config defaults file MISSING"
fi
(Stolen from /sbin/init.d/sendmail).
The above command looks for /etc/rc.config.d/[script name] ('netbackup' in your case) and then runs it to load the variables set.
After that variable is loaded, you can interrogate it within the start script.
#!/sbin/sh
# $Header: /kahlua_src/web/server/etc/webadmin 72.1 1999/09/16 03:51:04 lancer Exp $
# WebAdmin application server configuration.
#
# WEBADMIN: Set to 1 to start the WebAdmin application server.
#
WEBADMIN=0
(Example stolen from /etc/rc.config.d/webadmin)
Create your script in the file /sbin/init.d/netbackup, perform an 'ln -s' command to link it into /sbin/rc3.d/S[999]netbackup and /sbin/rc2.d/K[111]netbackup.
Easy peasy! Share and Enjoy! Ian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2003 10:52 AM
02-06-2003 10:52 AM
Re: Question about setting a program to startup automatically
I know this is more and less than what you are asking, but I am attaching the doc we used for starting a process.
We found this very straight forward and you can literally call any script. In your case, maybe one to perform the dependency checks you require.
Also note in the document, the non destructive way to test your SXXX script for errors.
Regards,
dl