设为首页 加入收藏

TOP

Linux 技巧:让进程在后台可靠运行的几种方法 (七)
2010-12-31 12:21:01 】 浏览:11523
Tags:Linux 技巧 进程 后台 可靠 运行 方法
─acpid
├─atd
├─2*[sendmail]
├─sshd─┬─sshd───bash───pstree
└─sshd───bash───ping

我们可以看出,未使用 screen 时我们所处的 bash 是 sshd 的子进程,当 ssh 断开连接时,HUP 信号自然会影响到它下面的所有子进程(包括我们新建立的 ping 进程)。


2. 使用了 screen 后新进程的进程树

[root@pvcent107 ~]# screen -r Urumchi
[root@pvcent107 ~]# ping www.ibm.com &
[1] 9488
[root@pvcent107 ~]# pstree -H 9488
init─┬─Xvnc
├─acpid
├─atd
├─screen───bash───ping
├─2*[sendmail]

而使用了 screen 后就不同了,此时 bash 是 screen 的子进程,而 screen 是 init(PID为1)的子进程。那么当 ssh 断开连接时,HUP 信号自然不会影响到 screen 下面的子进程了。

首页 上一页 4 5 6 7 下一页 尾页 7/7/7
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇一起写 Makefile 规则 下一篇Linux命令Man解释:useradd:帐号建..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目