- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- 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
06-11-2003 10:29 AM
06-11-2003 10:29 AM
init.rc script fails because tty detach
we tried to set an init script to start an application on system boot using an init script (rc).
The process starts but is killed by the next inittab line: getty console.
I know there is a way to "demonize" the process and then detach it from the console but I can't remember
what is the means.
I tried to "nohup" the script but it fails to detach the process from console
help needed!
thanx
Laurent
PS here is my inittab file:
init:3:initdefault:
ioin::sysinit:/sbin/ioinitrc >/dev/console 2>&1
tape::sysinit:/sbin/mtinit > /dev/console 2>&1
muxi::sysinit:/sbin/dasetup /dev/console 2>&1 # mux init
stty::sysinit:/sbin/stty 9600 clocal icanon echo opost onlcr ixon icrnl ignpar brc1::bootwait:/sbin/bcheckrc /dev/console 2>&1 # fsck, etc.
link::wait:/sbin/sh -c "/sbin/rm -f /dev/syscon; /sbin/ln /dev/systty /dev/syscon" >/dev/console 2>&1
cprt::bootwait:/sbin/cat /etc/copyright >/dev/syscon # legal req
sqnc::wait:/sbin/rc /dev/console 2>&1 # system init
#powf::powerwait:/sbin/powerfail >/dev/console 2>&1 # powerfail
cons:123456:respawn:/usr/sbin/getty console console # system console
#ttp1:234:respawn:/usr/sbin/getty -h tty0p1 9600
#ttp2:234:respawn:/usr/sbin/getty -h tty0p2 9600
#ttp3:234:respawn:/usr/sbin/getty -h tty0p3 9600
#ttp4:234:respawn:/usr/sbin/getty -h tty0p4 9600
#ttp5:234:respawn:/usr/sbin/getty -h tty0p5 9600
ems1::bootwait:/sbin/rm -f /etc/opt/resmon/persistence/runlevel4_flag
ems2::bootwait:/sbin/cat /etc/opt/resmon/persistence/reboot_flag
ems3:3456:wait:/usr/bin/touch /etc/opt/resmon/persistence/runlevel4_flag
ems4:3456:respawn:/etc/opt/resmon/lbin/p_client
#ups::respawn:rtprio 0 /usr/lbin/ups_mond -f /etc/ups_conf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2003 07:41 PM
06-11-2003 07:41 PM
Re: init.rc script fails because tty detach
Once you get your script finished and tested, copy it to the /sbin/init.d directory, then create start/stop links in /sbin/rc3.d so your script starts and stops in the right sequence. Look in /usr/share/doc for startup script information.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2003 08:21 PM
06-11-2003 08:21 PM
Re: init.rc script fails because tty detach
1. create script to shutdown oracle database & oracle application, and locate in /sbin/init.d
2. to start: create symbolic link on /sbin/rc3.d:
eg.
ln -s /sbin/init.d/oradb S800oradb
ln -s /sbin/init.d/oraapp S850oraapp
3. to stop: create symbolic like on /sbin/rc0.d:
eg.
ln -s /sbin/init.d/oradb K200oradb
ln -s /sbin/init.d/oraapp K150oraapp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2003 01:35 AM
06-12-2003 01:35 AM
Re: init.rc script fails because tty detach
I think you misunderstood me.
I showed the inittab file just to mention that it is when
cons:123456:respawn:/usr/sbin/getty console console # system console
starts that my rc3 script which is attached to the system console is killed by that getty .
So my question is : how can I detach my process launched by rc3 script from the console to avoid being killed by getty ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2003 09:03 AM
06-12-2003 09:03 AM
Re: init.rc script fails because tty detach
When you start a process in a start/stop script, the shell running the script will terminate and kill any child processes. That is why you must put nohup in front of the process (to protect the process from kill) and place the process into the background as in:
nohup /usr/contrib/bin/myprocess &
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2003 11:42 PM
06-12-2003 11:42 PM
Re: init.rc script fails because tty detach
But I already tried the nohup & and it doesnot change!
Maybe because myprocess is in fact forking a lot of new processes!
Laurent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2003 03:15 AM
06-13-2003 03:15 AM
Re: init.rc script fails because tty detach
UNIX95= ps -efH
This will show the parent-child relationship of all processes.
Bill Hassell, sysadmin