07-19-2002
I don't use Compaq. But there is something odd here. Yes, I would agree that if your tty field on "ps" is ??? then you have no controlling terminal. However it may be that you have either a session leader or a process group leader who does have a controlling terminal. I would just take extreme measures to make sure that this is not the case.
1) close all files. If no files are open, then no tty can be open.
2) fork() and let the parent exit. The child will continue to run. The parent might have been a process group leader. But the child cannot be one.
3) setsid() to become a session leader and process group leader.
4) fork() and let the parent exit. At this point the child has no process group leader nor a session group leader. It has no tty's open so it cannot have a controlling tty nor is it associated in any way with a process with a controlling terminal.
5) now run, but never open a tty. If you need to open a tty, fork, let the child it, then let the child exit.
This is more than should really be needed. But I'll bet the rent that it works.
8 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi
I have installed solaris 10 on an intel machine. Logged in as root. In CDE, i open terminal session, type login alex (normal user account) and password and i get this message
No utpmx entry: you must exec "login" from lowest level "shell" :confused:
What i want is: open various... (0 Replies)
Discussion started by: peterpan
0 Replies
2. UNIX for Dummies Questions & Answers
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I tried native compile Linux dialog for Linux embedded device
and got "curses.h" error message.
As Linux dialog is already compiled and working as Debian .deb package (installed it).
What is a way to import curses.h from other package sources to work for dialog sources compilation in my... (2 Replies)
Discussion started by: darius2
2 Replies
4. UNIX for Dummies Questions & Answers
Hello,
I am new to this forums and this is my first "asking help" message!
i have 2 problems:
1- for unknown reasons the "source" command is not avalable in my system (UBUNTU). i can't either see it in my bin directory!
2- again for unknown reasons the "login.cl" file in the home... (0 Replies)
Discussion started by: astrosona
0 Replies
5. Shell Programming and Scripting
hello,
i'm experimenting on "dialog" in shell scripting
consider an example :
dialog --passwordbox "password" 10 30
i need to take the password typed to a variable. how can i do it.
i tried it in perl by backticking the command. but its not working.
give me a solution ASAP......:) (2 Replies)
Discussion started by: sunjujohn
2 Replies
6. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
7. UNIX for Dummies Questions & Answers
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies
8. Shell Programming and Scripting
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies