Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a Mini2440 ARM Board, and I have put a base Debian 6.0 system on it using multistrap.

I have used tmux to run several processes in defferent windows from /etc/rc.local. I connect to the board using its serial port and an inittab entry to run getty on that port. I use picocom as serial communicator.

When root logs in, ~/.bashrc attaches him to the already running tmux server, and processes can be easily monitored. the actual command is exec tmux attach-session -t "main". tmux runs with default config.

Everything works, except one of the processes (a shell script around pppd) does not receive Ctrlc from terminal, while other processes do. Also Ctrl\ works. also kill -INT <pppd_pid> works, but kill -INT <shellscript_pid> does not.

I really need Ctrlc to work. What is wrong with this setup?

Edit: here is the output of stty -a in the shell script, right before pppd:

speed 38400 baud; rows 23; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke

since it's just pppd process that has this issue, I think it has something to do with it or its configuration, but when I run pppd outside of tmux, Ctrl-C works. pppd runs with nodetach option, so it stays in terminal foreground.

I also tested it on my dev machine (debian 6.0 on amd64) with the same results.

share|improve this question
6  
Does stty -a show intr = ^C? If not, what is the intr setting? (Note: stty -a | grep intr won't work, since it makes stty write to a pipe rather than to your tty.) Does Ctrl-V Ctrl-C echo ^C? If not, what does it echo? –  Keith Thompson Oct 6 '12 at 18:32
    
@KeithThompson Ctrl-V prints a ^ and Ctrl-C adds a C to it. –  aalizadeh Oct 7 '12 at 8:51
6  
This seems too obvious, but is there a trap command in the shell script? –  Keith Thompson Oct 8 '12 at 23:19
1  
pppd has no say in what its underlying shell decides to do with a direct SIGINT. Try writing a tiny shell script that invokes /bin/sleep 600 and send the shell process a SIGINT, you'll see the exact same thing. –  Andrew B Jan 6 '13 at 21:43
2  
I don't know tmux well enough but I suspect pppd detects that it doesn't have a terminal despite running under tmux and then ignores INT signals. a trace of pppd while it is started, as well as when tmux is "Detatched" the first time, will probably be telling. –  Johan Feb 28 '13 at 10:51

1 Answer 1

Have you ever thought about givin GNU screen a try? To be very honest i havent much experience with tmux, but screen always did the job nicely.

share|improve this answer
    
Screen is sexy and fantastic. A +1 for you. –  root Jul 20 '13 at 19:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.