- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- getting init to respawn indefinetly
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
12-29-2003 04:10 AM
12-29-2003 04:10 AM
getting init to respawn indefinetly
Is there a way to avoid the default behavior of init for my entries in inittab so that they can respawn quicker that 10 times per 2 minutes. I imagine this would even be a problem for something like getty that respawns from init, if you had a modem program that fast.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2003 04:15 AM
12-29-2003 04:15 AM
Re: getting init to respawn indefinetly
You can use this format for a down and dirty
proc=`ps -aef |grep "proc" |grep -v grep |wc -l`
while [$proc -ne 1 ]
do
...
...
done
Just off the top of my head, but should work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2003 04:35 AM
12-29-2003 04:35 AM
Re: getting init to respawn indefinetly
while :
do
/somedir/someprogram some_prameters..
sleep 1
done
That will re-run the program forever with a one second pause between each run. Just put this script name into a start/stop script in /sbin/init.d and link it into the /sbin/rc* directories.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2003 07:23 AM
12-29-2003 07:23 AM
Re: getting init to respawn indefinetly
#!/bin/sh
exit
So it will call itself right before it ends.
Best regards,
Kent M. Ostby
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2003 07:34 AM
12-29-2003 07:34 AM
Re: getting init to respawn indefinetly
#!/bin/sh
exec <script1>
The exec will run the "new" command in the current shell with out creating a new process.
-Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2003 11:15 AM
12-29-2003 11:15 AM
Re: getting init to respawn indefinetly
I wouldn't run all of them from init directly. Instead, use a script similar to that attached to keep a limited number of daemons running at all times.
I haven't thoroughly tested this, so be careful! You may end up filling up the process table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2003 05:32 PM
12-29-2003 05:32 PM
Re: getting init to respawn indefinetly
Script will look something like this:
#! /sbin/sh
PATH=/sbin:/bin # Add anything the daemon needs
export PATH
while true
do
sleep 1
done
Also, make sure the daemon doesn't fork-and-exit like normal daemons do... That might be the cause of your problem too, of course. You can check it by doing at the testing line:
if [ $(ps -ef | grep
then
echo Daemon exited, but is still running
exit
fi
Of course, check the script by just running it from command line.