daemontools manage UNIX services and script

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.

multilog saves error messages to one or more logs. It optionally timestamps each line and, for each log, includes or excludes lines matching specified patterns. It automatically rotates logs to limit the amount of disk space used. If the disk fills up, it pauses and tries again, without losing any data.


1.Install

     mkdir -p package
     chmod 1755 package
     cd package

Download  daemontools-0.76.tar.gz  into  package .

 wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz
Unpack the daemontools package:

tar zxvf daemontools-0.76.tar.gz
cd admin/daemontools-0.76
Compile and set up the daemontools programs:

package/install

Error.If you get an error informations such as this:

/usr/bin/ld: errno: TLS definition in /lib/libc.so.6 section .tbss mismatches non-TLS reference in [...]

slove problem:

1)edit src/conf-cc 

add "-include /usr/include/errno.h" on the end of first line.also,you can run this command on directory package/admin/daemontoos-0.76

sed -i '/gcc/s/$/ -include \/usr\/include\/errno.h/' src/conf-cc

2)find the /usr/include/errno.h,and replace the line:

extern int errno;

with

#include <errno.h>

you can run this command automatic:

sed -i '/extern int errno;$/s/extern int errno;/#include <errno.h>/' /usr/include/errno.h


start daemontools with system start:

tow ways:

1)apt-get install csh

/etc/rc.local

Put the line

     csh -cf '/command/svscanboot &'
at the end of  /etc/rc.local .

2)don't install csh

put the line

 sh -c '/command/svscanboot &'

2.use supervise program

my script path: ~/test/run

user this command:

supervise ~/test &
the script name must be "run"







评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值