- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- rc scripts starting background processes?
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
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
тАО11-07-2001 06:52 AM
тАО11-07-2001 06:52 AM
Thanks,
Eric
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-07-2001 06:54 AM
тАО11-07-2001 06:54 AM
Re: rc scripts starting background processes?
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-07-2001 06:57 AM
тАО11-07-2001 06:57 AM
Re: rc scripts starting background processes?
A number of startup scripts run commands in the background, e.g. omni,cmcluster. Try typing:
grep ' &$' /sbin/init.d/*
to see examples. As long as your scripts are not interactive or need to be attached to a device, you should be OK.
Rgds, Robin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-07-2001 06:58 AM
тАО11-07-2001 06:58 AM
Re: rc scripts starting background processes?
I have 2 processes currently that according to the rc.log attempt to start but not actually start. Both of these are shell scripts, one running a disk archive ever 5 seconds, and the other is used to launch BigBrother. Neither of these start up. But the ones I have added that actually launch a daemon application work just fine.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-07-2001 07:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-07-2001 07:02 AM
тАО11-07-2001 07:02 AM
Re: rc scripts starting background processes?
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-07-2001 07:05 AM
тАО11-07-2001 07:05 AM
Re: rc scripts starting background processes?
If your script runs to completion and then exits there is no need to '&' or nohup it.
You do need to make certain that no interactive input is expected. You also need to make certain that you handle stdout and stderr correctly and return expected status to rc. However, if you are setting up a daemon, then you probably need to put in trap statements to ignore or properly handle signals. e.g. what do you want your daemon to do when it receives a kill -1? Die or reread some configuration file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-07-2001 07:18 AM
тАО11-07-2001 07:18 AM
Re: rc scripts starting background processes?
yes, you can start rc
scripts as backgroupd processes. For an example
here are couple of scripts
in the /sbin/init.d which
use nohup and & for
doing it:
*****
hparamgr:
nohup ${ARRAY_STARTUP_FILE} >> ${HPARAMGR_OUTPUT} 2>&1 &
hparray:
nohup ${ARRAY_STARTUP_FILE} >> ${ARRAYSCAN_OUTPUT} 2>&1 &
slsd: nohup /usr/bin/X11/SLSd_daemon 1> /dev/null 2>&1 &
spa: # Use nohup so getkinfo is allowed to keep running after the
spa: nice -5 nohup /usr/sam/lbin/getkinfo -b >/dev/null 2>&1 &
*****************
So, yes you can use
the same format as above
for running your script.
Regarding your other question, whether the rc scripts start off in background automatically -
No, it basically depends on the commands. For instance most of the rc scripts either do immediate tasks (mount fs ..) or start of daemons (nfs ..) . So, they didnt
need nohup or & . Whereas
if you want to some script as a background which should not die, you need to set it up
as a nohup bg process.
HTH
raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-07-2001 07:21 AM
тАО11-07-2001 07:21 AM
Re: rc scripts starting background processes?
Again thanks for the assistance!