分页: 1 / 1

假设通过ssh,telnet连接服务器运行程序(程序运行过程中不需要与终端交互),如果此时网络断了(ssh,telne)

发表于 : 2012-11-26 10:36
cxytz01
假设通过ssh,telnet连接服务器运行程序(程序运行过程中不需要与终端交互),如果此时网络断了(ssh,telnet断开连接),那么程序会怎么样? 程序会被终止吗?

Re: 假设通过ssh,telnet连接服务器运行程序(程序运行过程中不需要与终端交互),如果此时网络断了(ssh,te

发表于 : 2012-11-26 10:40
枫叶饭团
应该是会被关掉

Re: 假设通过ssh,telnet连接服务器运行程序(程序运行过程中不需要与终端交互),如果此时网络断了(ssh,te

发表于 : 2012-11-26 11:04
cxytz01
cxytz01 写了:假设通过ssh,telnet连接服务器运行程序(程序运行过程中不需要与终端交互),如果此时网络断了(ssh,telnet断开连接),那么程序会怎么样? 程序会被终止吗?

忘了补充下,我的程序不是精灵程序。就是普通的程序。

Re: 假设通过ssh,telnet连接服务器运行程序(程序运行过程中不需要与终端交互),如果此时网络断了(ssh,te

发表于 : 2012-11-26 11:36
yaoms
用 nohug 启动就不会给挂掉。screen里也可以幸存

Re: 假设通过ssh,telnet连接服务器运行程序(程序运行过程中不需要与终端交互),如果此时网络断了(ssh,te

发表于 : 2012-11-26 16:14
zhangxiaofir
经测试 在终端运行find 命令 查找很多文件 然后在虚拟机里能查到find进程 将虚拟机网络断掉后 进程被杀死。 ls说的nohug 没有找到 倒是找到个nohup
NOHUP(1) User Commands NOHUP(1)

NAME
nohup - run a command immune to hangups, with output to a non-tty

SYNOPSIS
nohup COMMAND [ARG]...
nohup OPTION

DESCRIPTION
Run COMMAND, ignoring hangup signals.

--help display this help and exit

--version
output version information and exit

If standard input is a terminal, redirect it from /dev/null. If stan-
dard output is a terminal, append output to ‘nohup.out’ if possible
‘$HOME/nohup.out’ otherwise. If standard error is a terminal, redirect
it to standard output. To save output to FILE, use ‘nohup COMMAND >
FILE’.

NOTE: your shell may have its own version of nohup, which usually
supersedes the version described here. Please refer to your shell’s
documentation for details about the options it supports.

Re: 假设通过ssh,telnet连接服务器运行程序(程序运行过程中不需要与终端交互),如果此时网络断了(ssh,te

发表于 : 2012-12-08 13:22
occultist
nohup <command>[argument...] &