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

全部博文(85)

文章存档

2011年(15)

2010年(37)

2009年(17)

2008年(16)

我的朋友

分类: 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.

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