- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to detach a process from the assigned tty?
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
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
тАО06-12-2003 07:07 AM
тАО06-12-2003 07:07 AM
Does anybody know how I can detach a process from its tty?
I can't find a way!
Laurent
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2003 07:13 AM
тАО06-12-2003 07:13 AM
Re: how to detach a process from the assigned tty?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2003 07:14 AM
тАО06-12-2003 07:14 AM
Re: how to detach a process from the assigned tty?
You could try the kill -HUP function, but please be carefull.
Regs David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2003 07:15 AM
тАО06-12-2003 07:15 AM
Re: how to detach a process from the assigned tty?
write 'message' tty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2003 07:25 AM
тАО06-12-2003 07:25 AM
Re: how to detach a process from the assigned tty?
I know this to do programmatically. Normally when daemons are created they will detach themselves from the tty which started it for they can run in the background, free from any signals from the tty, etc.
HTH,
Umapathy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2003 07:25 AM
тАО06-12-2003 07:25 AM
Re: how to detach a process from the assigned tty?
It is easy from the programming level. You use setsid(); it's one of the basic things you do to "daemonize" a process in C or Perl.
You can also look into the nohup command but all of these assume that you do this "on the front end" not after the process has been started.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2003 07:50 AM
тАО06-12-2003 07:50 AM
Re: how to detach a process from the assigned tty?
depending on what do you want to do, you have two solution:
- if unattended: start your job with a "nohup" at the beginning and an "&" at the end. This ways it will continue to work even if the tty is closed.
- if attended: install a tool like "screen", it can attach and detach from its sessions.
ctrl-a,d detach from current session
screen -l reattach to a detached session.
see the man for more details...
Downloadable free from
http://hpux.connect.org.uk/
HTH,
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2003 07:52 AM
тАО06-12-2003 07:52 AM
Re: how to detach a process from the assigned tty?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2003 08:35 AM
тАО06-12-2003 08:35 AM
Re: how to detach a process from the assigned tty?
In fact what I want is to demonize a process launched at startup through /sbin/init.d/myprocess
It appeared that it starts but fails later because of inittab getty console init.
myprocess appears to be attached to the system console and it forks a lot of processes (all are then attached to the console). When getty init the console (that happens after init.d due to inittab sequence) all my processes stop!
I think the setsid() is the solution I will try to use it in a perl script and let you know how it works!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2003 08:51 AM
тАО06-12-2003 08:51 AM
Solution