- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: init.rc script fails because tty detach
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
07-15-2005 11:43 AM
07-15-2005 11:43 AM
The process starts but is killed by the next inittab line: getty console.
Is there any way to "demonize" the process and then detach it from the console.
I tried to "nohup" the script but it fails to detach the process from console.
Manoj
Solved! Go to Solution.
- Tags:
- rc(1M)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2005 12:35 PM
07-15-2005 12:35 PM
Re: init.rc script fails because tty detach
May be your script is starting the process too early (that means at a point where other necessary system process still to start) and thats why it is getting killed.
Try starting the script manually after the system is booted. If this works fine put your script in /sbin/init.d folder and then create a link from /sbin/rc2.d. Adjust the link name so as to run it at the last of run level 2. Link name should be in Sxxx format.
Hope this helps
Sudeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2005 01:08 PM
07-15-2005 01:08 PM
Re: init.rc script fails because tty detach
I am not sure what process needs to be started this early in the boot-up sequence but if you just time the start of your program, and run it on the background with nohup, there should not be any problems.
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2005 11:28 PM
07-16-2005 11:28 PM
Re: init.rc script fails because tty detach
What are you trying to daemonize anyway?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2005 11:31 PM
07-16-2005 11:31 PM
Re: init.rc script fails because tty detach
Some applications grab STDIN, STDOUT and STDERR rather firmly when they start, even if they are backgrounded. Sometimes you need to force thse file-descripters to go elsewhere, i.e.:
nohup processname < /dev/null > /dev/null 2>&1 &
But tell us what you're trying to background like this in the RC scripts, and we'll see if there's a better way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2005 01:18 AM
07-17-2005 01:18 AM
Re: init.rc script fails because tty detach
Could delaying the script for sometime will help ? I would thought of giving it a try. Delay the script for atleast 10-20 secs for it to start before proceding to execute the next script.
But can not it be done by putting it somewhere in /sbin/init.d and link to required runlevel as Sudeesh mentioned. A brief desciption of what you are trying to achive will help us a bit to help you better.
HTH,
Devender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2005 03:06 PM
07-17-2005 03:06 PM
Re: init.rc script fails because tty detach
As Sudeesh suggested the best way would be to try the script once the system is booted. If the script works fine the you can use the template in /sbin/init.d to customize your script. Then based on requirement of the script place it in either rc2.d/rc3.d/...
Cheers!!!
eknath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2005 04:26 AM
07-18-2005 04:26 AM
Re: init.rc script fails because tty detach
Same startup script works fine if I run manually.
startup script - /sbin/init.d/xvfb
and it is link to /sbin/rc3.d/S995xvfb
Now the problem is:
When system starts script starts xvfb and mwm, below is the process details
â root 4886 1 0 22:31:14 console 0:03 /usr/bin/X11/X :10 -ac -fbdir /var/X11/Xserverâ
â root 4890 1 0 22:31:44 console 0:00 /usr/bin/X11/mwm -display :10â
This process status remain same untill the system console login prompt comes.
After that xvfb remain running with below process status and mwm process automatically dies.
root 4886 1 0 22:31:14 ? 0:03 /usr/bin/X11/X :10 -ac -fbdir /var/X11/Xserver
Please tell me how to "demonize" the mwm process and then detach it from the console as what is happening with xvfb automatically.
Thanks and Regards
Manoj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2005 04:35 AM
07-18-2005 04:35 AM
Re: init.rc script fails because tty detach
Just repeating
xvfb & mwm process status
before system console login prompt comes
root 4886 1 0 22:31:14 console 0:03 /usr/bin/X11/X :10 -ac -fbdir /var/X11/Xserver
root 4890 1 0 22:31:44 console 0:00 /usr/bin/X11/mwm -display :10
After system console login prompt comes
only xvfb survive and mwm dies
root 4886 1 0 22:31:14 ? 0:03 /usr/bin/X11/X :10 -ac -fbdir /var/X11/Xserver
Regards
Manoj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2005 05:30 AM
07-18-2005 05:30 AM
Re: init.rc script fails because tty detach
I am under the impression that you have not tried the nohup option yet. Did you ?
in your startup script, make sure you have somthing like this :
DISPLAY=`/usr/bin/hostname`:10; export DISPLAY
nohup sh -c '/usr/bin/X11/Xvfb :10 -ac \
-fbdir /var/X11/Xserver & ; \
sleep 5; /usr/bin/X11/xhost + ; \
/usr/bin/X11/mwm &' > /dev/null
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2005 05:58 AM
07-18-2005 05:58 AM
Re: init.rc script fails because tty detach
You are exactly right.
But that does not work to "demonize" the mwm process in the system startup.
Do you have any other catch on it???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2005 06:52 AM
07-18-2005 06:52 AM
Re: init.rc script fails because tty detach
Some programs have the option of running themselves ad daemons, like sendmail, with proper command switches but a quick glance over mwm does not show anything close to this.
Also, running a process in the background, doing whatever you are expecting from it to do, is not much different than the actual daemon functionality, maybe with a bit of extra overhead due to shell handling etc. What else are you after by runnig it as a *true* daemon ?
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2005 09:19 AM
07-18-2005 09:19 AM
Solution- Tags:
- daemon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2005 12:28 AM
07-19-2005 12:28 AM
Re: init.rc script fails because tty detach
Finally the the story end successfully!!!
Special thanks to Stephenson for wonderful perl script.
Thanks & Best Regards
Manoj