Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1829101
  • 博文数量: 283
  • 博客积分: 10141
  • 博客等级: 上将
  • 技术积分: 2931
  • 用 户 组: 普通用户
  • 注册时间: 2005-12-21 14:33
文章分类

全部博文(283)

文章存档

2013年(2)

2012年(2)

2011年(17)

2010年(36)

2009年(17)

2008年(18)

2007年(66)

2006年(105)

2005年(20)

分类: LINUX

2008-08-11 15:10:00

需求来源,当一个进程不存在的时候,启动。
1. pidof
会返回所有的进程号,但是限制在于程序名不能过长,strace可以看到读入的参数只有前15个字符。
2. ps aux | grep | grep -v grep | wc -l
返回有program有几个进程存在
3. 进程启动时将进程号写入一个文件,检查时cat /proc//cmdline,看是否为自己需要的程序名。
4. supervise
daemontools
What is it?
daemontools is a collection of tools for managing UNIX services.

supervise monitors a service. It starts the service and restarts the service if it dies. Setting up a new service is easy: all supervise needs is a directory with a run script that runs the service.

阅读(2146) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~