Operating System - HP-UX
1834142 Members
2365 Online
110064 Solutions
New Discussion

Re: Control C doesnt function under bourne shell under UX 11.00

 
HP Cluster
Advisor

Control C doesnt function under bourne shell under UX 11.00

Hi,

When i login to one of our systems the contol-c function doesnt work.
I looked in my .profile but there nothing seems wrong, the intr is set by stty intr ^C so that should work fine.
Also ^X ^D and ^H are set but these work fine.
Is this a know problem and what could i do to solve it.

Anyway thx

Ernst Cozijnsen
Cap Gemini Ernst & Young the Netherlands
9 REPLIES 9
John Palmer
Honored Contributor

Re: Control C doesnt function under bourne shell under UX 11.00

Hi,

First, I'd check your intr setting with stty -a. Also check that ^C isn't assigned to anything else.

Regards,
John
HP Cluster
Advisor

Re: Control C doesnt function under bourne shell under UX 11.00

i did stty -a and i see:

speed 9600 baud; line = 0;
rows = 69; columns = 132
min = 1; time = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^U
eof = ^D; eol = ^@; eol2 ; swtch
stop = ^S; start = ^Q; susp = ^Z; dsusp = ^Y
werase = ^W; lnext = ^V
-parenb -parodd cs8 -cstopb hupcl cread -clocal -loblk -crts
-ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
ixon ixany -ixoff -imaxbel -rtsxoff -ctsxon -ienqak
isig icanon -iexten -xcase echo echoe echok -echonl -noflsh
echoctl -echoprt echoke -flusho -pendin
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel -tostop

So this should be normaol though
John Palmer
Honored Contributor

Re: Control C doesnt function under bourne shell under UX 11.00

Yes that looks normal. The only other thing that I can think of is that your shell is ignoring signal 2.

If you input the command

trap 2

does ctrl C then work?

If it does then it looks as though someone has amended /etc/profile. This runs 'trap "" 1 2 3' (to ignore those signals) at the start and 'trap 1 2 3' at the end. Check to see if the last one has been deleted.

Regards,
John
HP Cluster
Advisor

Re: Control C doesnt function under bourne shell under UX 11.00

I tryed that one but it keeps ignoring it.

if i do "stty intr ^K" for example then control +c works i see ^C at the prompt.
When i hit control+k the cursor doesnt move so it seems the intr signal gets stuck somewhere.
I also think it has something to do with the traps but just cant figureout what.
John Palmer
Honored Contributor

Re: Control C doesnt function under bourne shell under UX 11.00

What output do you get from

trap

??
Dietmar Konermann
Honored Contributor

Re: Control C doesnt function under bourne shell under UX 11.00

Hi!

Really weird symptom... did you already check if the problem is the same for all users?

Are there differences for users with different login shells? (/sbin/sh, /usr/bin/sh, /usr/bin/ksh, /usr/bin/csh)

Regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
HP Cluster
Advisor

Re: Control C doesnt function under bourne shell under UX 11.00

when i do "trap 2" there is no further output given.

I tried it with all the shells and all users and it makes no difference.
I placed a call at HP in the netherlands and they also didnt know the problem but they advised to reboot the machine.

uhh well it aint windows though!

But ok tonight we'll reboot the machine and look what happens in the morning.
John Palmer
Honored Contributor

Re: Control C doesnt function under bourne shell under UX 11.00

It sounds as though your shell's parent process (or the parent of that...) has chosen to ignore signal 2 (trap "" 2).

Man sh-posix states 'Any attempt to set a trap on a signal that was ignored upon entering the current shell is ineffective.' so you can't reinstate it with 'trap 2' or see it with 'trap'.

If your shell has a parent shell then it's possible that /etc/profile or a .profile is issuing 'trap "" 2'. If your shell is owned by telnetd than you need to check:
- how telnetd is started by inetd
- how inetd is started (one of the system startup scripts may have been amended)

I don't think that a reboot is going to fix this.

Regards,
John
HP Cluster
Advisor

Re: Control C doesnt function under bourne shell under UX 11.00

Well after the machine whas rebooted the problem whas gone and everything worked fine again.

Anyway tnx all for helping.

Regards,

Ernst Cozijnsen