问题
Objective:
I am working on an iOS terminal emulator for accessing my Unix server through the telnet protocol. I am testing against both AIX and Fedora Linux.
Problem:
If I send Ctrl-Z (ASCII 26) to the AIX server, it behaves as expected: I get back a string like stopped programname
, and then any further characters I send get echoed back.
When I send it to the Fedora server, I get no echo-back until I send Ctrl-Z a second time. The program is running under Bash on the Fedora machine.
Why am I seeing this difference in behavior?
回答1:
You have to make 2 calls:
Stopping that process
kill -SIGSTOP 'pgrep process_name'
Continuing that process
kill -SIGCONT 'pgrep process_name'
SIGSTOP tells a process to “hold on” and SIGCONT tells a process to “pick up where you left off”
See, if that help.
来源:https://stackoverflow.com/questions/28380426/ctrl-z-sent-to-fedora-server-over-telnet-does-not-stop-the-process