- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- need tty settings in startup script
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
03-15-2004 02:03 AM
03-15-2004 02:03 AM
need tty settings in startup script
In syslog it shows a message tty??.
In fact I need to set stty intr "^C" before starting the process as it inherits this setting from its invoking process.
Unfortunately I do not have a tty at boot time.
How can I bind a pseudo tty to the startup script so that I can do some stty settings before I start my program?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2004 02:08 AM
03-15-2004 02:08 AM
Re: need tty settings in startup script
set the shell to be used in the script itself.
#!/usr/bin/csh
and then set stty intr "^C"
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2004 02:38 AM
03-15-2004 02:38 AM
Re: need tty settings in startup script
stty intr "^C"
If you would like to set it for all new terminal connections, then use device /dev/ttyconf. example-
stty intr "^C"
Then all new terminal connections (except /dev/console) will have that intr set to ^C.
Note- If you reboot your system, you must run stty again. See "man stty" for more info.
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2004 02:50 AM
03-15-2004 02:50 AM
Re: need tty settings in startup script
stty needs a controlling tty and there is no good way to do this.
You need to set this when you run your process
Then it will be ok
Make an alias unisg #!/bin/sh
processname="stty intr \"^C\";/a/b/c/procssname"
Then typing processname will do both
Steve STeel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2004 03:11 AM
03-15-2004 03:11 AM
Re: need tty settings in startup script
I suspect the better approach is to modify your script no to require interactive commands.
e.g.
if [ -t 0 ]
then
stty ...
tset ...
tabs ...
fi
Only when stdin is a tty device will the commands be executed. If you are doing something in your rc script like su - someuser .... then change your script to explicitly set env vars and simply invoke as su someuser ... so that the .profile is not used. Ideally both someuser's .profile AND your script would source the same file via the "." (dot) shell operator to set any needed environment variables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2004 01:17 AM
03-16-2004 01:17 AM
Re: need tty settings in startup script
Unfortunately there is a problem on HPUX 10.20 that the sshd inherits the intr setting at startup time and it can not be set again from within an ssh connection!
Thus if stty intr "^C" was not defined at sshd start no ssh client can use Ctrl-C and client sessions can not interrupt any command.
As there is no stty associated to the rc script I am looking for a way to set 'intr' before the daemon is started so that it accepts Ctrl-C correctly.