Ctrl-Z sent to Fedora server over telnet does not stop the process

柔情痞子 提交于 2019-12-23 04:45:47

问题


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:

  1. Stopping that process

    kill -SIGSTOP 'pgrep process_name'

  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!