- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Running Unix Command without attaching to 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
Forums
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
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
тАО02-25-2009 04:39 PM
тАО02-25-2009 04:39 PM
We observed PowerBroker running some unix privileged commands attached to a TTY device. When it times out due to some inactivity then it dies and eventually kills other applications supposed to run with PowerBroker privileged access.
I was thinking to execute the command like "$./nohup
My question is:
Does nohup works with any unix command or is there any exception ?
Thanks,
Shiv
Solved! Go to Solution.
- Tags:
- nohup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-25-2009 04:59 PM
тАО02-25-2009 04:59 PM
Re: Running Unix Command without attaching to TTY
I am not aware of any commands that cannot be used with nuhup.
Don't forget to monitor the size of nohup.out, and also use a '&' if you want the command in the background.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-25-2009 05:13 PM
тАО02-25-2009 05:13 PM
Re: Running Unix Command without attaching to TTY
I believe it works with all commands except those that require keyed input.
Works with nearly every script I ever wrote except that type.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-25-2009 05:14 PM
тАО02-25-2009 05:14 PM
Re: Running Unix Command without attaching to TTY
Yes, 'nohup' should work with any command (or script). Redirect STDOUT and STDERR to a file of your choice. Otherwise, output will be sent to 'nohup.out'. When run with 'nohup' the hang-up (SIGHUP) and quit (SIGQUIT) signals are ignored.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-25-2009 05:32 PM
тАО02-25-2009 05:32 PM
Solution> SEP:
I believe it works with all commands except those that require keyed input.
You can redirect STDIN to accomodate this:
# nohup mything > /tmp/mything.log 2>&1 < /dev/null
...or if you need specific input responses, put them on separate lines in a file and redirect that in lieu of '/dev/null'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-25-2009 08:32 PM
тАО02-25-2009 08:32 PM
Re: Running Unix Command without attaching to TTY
We have an application which is started when remote hardware makes a connection to a specific port. The developer's application would not run directly from inetd, we tried it, but would exit with an error message stating that it required a tty. The developer's solution was to used rlogin to provide the tty. This worked, but we were not happy with the use of rlogin. We have since replaced the developer's script with a simple "expect" script. The expect programming language provides the tty, and we are now able to disable rlogin in inetd.conf.
- Tags:
- expect
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2009 11:11 AM
тАО02-26-2009 11:11 AM
Re: Running Unix Command without attaching to TTY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2009 11:34 AM
тАО02-26-2009 11:34 AM
Re: Running Unix Command without attaching to TTY
it is not advised to detached with nohup
process like vi, more, which open /dev/tty.
else there is no other problem
if you need to have a tty, you can use
rlogin, ssh, or redirect stdin to /dev/console for instance.
rlogind and sshd and telnetd open a master pty and a slave pty which is passed to its child process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2009 08:16 PM
тАО02-26-2009 08:16 PM
Re: Running Unix Command without attaching to TTY
But I regularly use screen to keep my session alive after I have disconnected from the machine.
You can also start your process in a screen session and detach. You can have any kind of(text only) application running under screen no need to worry about the keyboard input and output.
- Tags:
- screen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2009 09:17 PM
тАО02-26-2009 09:17 PM
Re: Running Unix Command without attaching to TTY
Could you please elaborate ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-27-2009 12:46 AM
тАО02-27-2009 12:46 AM
Re: Running Unix Command without attaching to TTY
http://en.wikipedia.org/wiki/GNU_Screen
http://www.gnu.org/software/screen/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2009 02:14 PM
тАО02-28-2009 02:14 PM
Re: Running Unix Command without attaching to TTY
- Tags:
- daemon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2009 02:50 PM
тАО02-28-2009 02:50 PM
Re: Running Unix Command without attaching to TTY
> Also i think if a process runs as a daemon process then it does not attach to TTY... is this correct statement ?
A daemon begins life when its parent process fork()'s and exit()'s. The new process then _detaches_ itself from its controlling terminal (TTY) as a part of becoming a daemon. This is done via a 'setsid()' system call. Doing this prevents the daemon from receiving any signals from the terminal that it was once (by inheritence) connected to.
Too, STDIN, STDOUT and STDERR which are usually associated with a terminal, are either cloasd or opened to '/dev/null' or a file as necessary. You _could_ (for example) open STDOUT to a terminal and let your daemon process write to it, but then why have a daemon(?).
Regards!
...JRF...