cancel
Showing results for 
Search instead for 
Did you mean: 

HELP!! SIGTTIN received!

SOLVED
Go to solution
Enrico Venturi
Super Advisor

HELP!! SIGTTIN received!

Hello colleagues,
something strange happens in a my application in HP UX 10.20 environment:
I've an application started at the boot (by init) as root user; it forks some children; when one of them tries to execute a "su - snml " a signal 27 is received by the father ... signal 27 = SIGTTIN, it seems it tries to read from TT input ... wher can I look for the variable read?? is it in the snml .profile or .kshrc files??

thanks a lot
Enrico
2 REPLIES
Mark Greene_1
Honored Contributor
Solution

Re: HELP!! SIGTTIN received!

The terminal interaction could be in either or both; it could be coming from /etc/profile if that has been modified from the default; it could be coming from a script called by the .profile; it could be generated by a command like tset or tput.

When you find the culprit, should you determine that you cannot change the script due to the needs of an interactive login, one thing you can do it create a user to mirror snml, make sure it belongs to the same groups, and then copy the .profile and .kshrc file to the new users home directory. You can then make the mods you need to get it to run in the background. Of course, you'll also have to change your app to su to the new user ID.

HTH
mark
the future will be a lot like now, only later
James R. Ferguson
Acclaimed Contributor

Re: HELP!! SIGTTIN received!

Hi Enrico:

I agree with Mark. Execution of the 'su -' sequence causes the user's $HOME/.profile to be read. Typically, profiles execute 'tset' and 'stty' commands in order to determine the terminal type and configuration suring login sequences. In your case, there is no terminal, hence the 'sigttin'.

You could resort to a simple 'su' without the '- user' which would prevent the sourcing (reading) of the user's profile, or you could modify the user's $HOME/.profile to incorporate conditional execution of 'stty' and 'tset' commands:

...
if [ -t 0 ]; then #...interactive to terminal
...

If you have environmental variables that you have incorporated into a user's profile and that's the only reason to source the profile with 'su -' then, move those variables into another file that not only the $HOME/.profile can source (read), but any script can too.

To source (read) do:

. myvars

Note that that's "dot", "space" and then the filename.

Regards!

...JRF...