浙江省高等学校教师教育理论培训

微信搜索“教师资格证岗前培训”小程序

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

http://barkingiguana.com/2008/11/28/running-daemontools-under-ubuntu-810/

Running Daemontools under Ubuntu 8.10

Daemontools is a collection of tools that help keep manage processes. It's great for keeping daemons running - if they ever die then Daemontools just restarts them. Unfortunately the package for Ubuntu is a little broken because it relies on /etc/inittab and Ubuntu hasn't used this file for a long time. Here's how install Daemontools and fix the problem.

Installing Daemontools

This bit is easy.

sudo apt-get install daemontools

Daemontools is installed. Easy, huh? Unfortunately it won't start after a reboot. That's bad. The daemontools-run package was meant to make Daemontools start at system bootup but unfortunately it relies on a system that uses init... and Ubuntu doesn't. It uses upstart instead.

Make Daemontools run at system startup

Create the file /etc/event.d/svscanboot with the following content.

start on runlevel 2
start on runlevel 3
start on runlevel 4
start on runlevel 5

stop on runlevel 0
stop on runlevel 1
stop on runlevel 6

respawn
exec /usr/bin/svscanboot

You'll also need to mkdir /etc/service since this is where the Ubuntu-installed Daemontools looks for service definitions.

Now tell the system to start the process.

sudo initctl start svscanboot

Other distributions

Plenty of other distributions use upstart instead of init. Getting DaemonTools running on them is pretty similar.

 

 

daemontools

How to install daemontools
Upgrading from previous versions of daemontools
Frequently asked questions

How to start daemontools
The svscanboot program
The svscan program
The supervise program
The svc program
The svok program
The svstat program
The fghack program
The pgrphack program

The readproctitle program
The multilog program
The tai64n program
The tai64nlocal program

The setuidgid program
The envuidgid program
The envdir program
The softlimit program
The setlock program


The logging utilities in daemontools are discussed on the log mailing list.

 

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.

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.   

    posted on 2012-02-06 09:20  lexus  阅读(304)  评论(0编辑  收藏  举报