返回主页
虚拟光驱软件 DaemonTools 安装说明
ucspi-tcp 软件包安装说明
tcpserver 使用详解
设置一个 daytime 服务器
命令行版 tcpserver 安装指南

虚拟光驱软件 daemontools-0.76 安装说明

下面的安装说明是 BLFS 指导书的一部分(请查看 Beyond Linux From Scratch),但是由于某些原因这部分内容被移除了。我将这部分说明略做修改贴在下面。 

软件包信息

附件下载


安装 daemontools

运行下面的命令安装 daemontools:


tar xvzf daemontools-0.76.tar.gz &&
cd admin/daemontools-0.76 &&
patch -Np1 -i ../../daemontools-0.76.errno.patch &&
package/compile &&
cd package &&
sed 's|/command|/usr/sbin|' boot.inittab > boot.inittab~ &&
mv -f boot.inittab~ boot.inittab &&
cd ../command &&
sed -e 's|/command:/usr/local/bin:/usr/local/sbin:||' \
    -e 's|/command/svc|/usr/sbin/svc|' svscanboot > svscanboot~ &&
mv -f svscanboot~ svscanboot &&
chmod +x svscanboot &&
/bin/cp * /usr/sbin &&
cd ../package &&
cat /etc/inittab boot.inittab > /etc/inittab~ &&
mv -f /etc/inittab~ /etc/inittab &&
mkdir /service &&
telinit Q

用户手册没有包含 tarball 的安装说明,如果你想要在线帮助的话,安装此软件包。


tar xvzf daemontools-0.76-man.tar.gz &&
cd daemontools-man &&
gzip *.8 &&
cp *.8.gz /usr/share/man/man8

核查您的安装


pstree -p

You should see approximately this in the output:


`-svscanboot(156)-+-readproctitle(162)
                  `-svscan(161)

命令解释

Most of the commands deal with avoiding the /command directory. There are very few packages out there that use it, so you might not want to create it. I strongly suggest creating the /service directory though.

cd admin/daemontools-0.76: First off, the package is unpacked in an admin directory. You will find the actual packages two directory levels below this.

package/compile: This command actually compiles the source and prepares the binaries.

Since we are installing the binaries in /usr/sbin rather than creating a non-standard /command directory, several paths have to be changed:


sed 's|/command|/usr/sbin|' boot.inittab > boot.inittab~ &&
mv -f boot.inittab~ boot.inittab

In boot.inittab, /command/svscanboot is changed to /usr/sbin/svscanboot.


sed -e 's|/command:/usr/local/bin:/usr/local/sbin:||' \
    -e 's|/command/svc|/usr/sbin/svc|' svscanboot > svscanboot~ &&
mv -f svscanboot~ svscanboot

Here various paths are adjusted in the svscanboot script.


/bin/cp * /usr/sbin

We must manually copy the binaries to the /usr/sbin directory.


cat /etc/inittab boot.inittab > /etc/inittab~ &&
mv -f /etc/inittab~ /etc/inittab

These commands append a line to /etc/inittab so that init will launch the svscanboot script.


mkdir /service

This command creates the daemontools control directory, which - even if empty - needs to exist for daemontools to run properly.


telinit Q

This command tells the init process to re-read its configuration file (inittab) and act upon any changes that have been made. The svscanboot script is started.

内容

The daemontools package contains svscanboot, svscan, supervise, svc, svok, svstat, fghack, pgrphack, readproctitle, multilog, tai64n, tai64nlocal, setuidgid, envuidgid, envdir, softlimit and setlock. More detailed descriptions of these commands may be found at http://cr.yp.to/daemontools.html.

Description

svscanboot

svscanboot is simply a script that calls svscan and pipes its output to readproctitle.

svscan

svscan checks the service directory for daemons to run and starts a supervise process for each run script that it finds.

supervise

supervise runs the run script passed to it by svscan and monitors the process the script starts so that if it dies, supervise restarts it.

svc

svc sends signals to processes being run under supervise.

svok

svok checks to see that supervise is running in the directory passed to it.

svstat

svstat prints the status of processes monitored by supervise.

fghack

fghack prevents processes from putting themselves into the background.

pgrphack

pgrphack runs a process in a separate process group.

readproctitle

readproctitle displays log entries in the output of ps.

multilog

multilog is a logging program. It takes output from a daemon and appends it to any number of logs.

tai64n

tai64n is a timestamp generating program.

tai64nlocal

tai64nlocal converts output of tai64n into a human readable format.

setuidgid

setuidgid runs a specified program under a given account's UID and GID.

envuidgid

envuidgid performs the same function as setuidgid, but sets environment variables UID and GID equal to the UID and GID of the account specified.

envdir

envdir runs a given program with environment variables specified by files in a directory.

softlimit

softlimit allows resource limits to be set for a given program.

setlock

setlock locks a file and runs a program.


联系我们:

Stefan Krah <website @ bytereef.org>

本站内容由中国分布式计算总站组织翻译。