我怎样才能使守护进程运行一个简单的服务,而无需手动调用监督?

根据networking上的各种入门指南,我用来从没有安装守护进程到有自动运行的简单服务的步骤顺序如下(在Ubuntu 14.04上):

$ sudo apt-get install daemontools $ sudo apt-get install daemontools-run # not clear if this is necessary $ sudo apt-get install csh # unsure why csh would be needed to run dt $ sudo mkdir /service $ sudo mkdir /service/test $ sudo chmod 1755 /service/test $ vi /service/test/run # see below $ vi /etc/rc.local # see below $ # tried power cycling here too $ sudo svstat /service/test # Why is supervise not running here? /service/test/: supervise not running $ sudo supervise /service/test/ > /dev/null & [1] 2747 $ sudo svstat /service/test/ /service/test/: up (pid 2758) 1 seconds ######################################################### # contents of /service/test/run: #!/bin/sh echo Running service exec echo hello ######################################################### # contents of /etc/rc.local #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. csh -cf '/usr/bin/svscanboot &' exit 0 

另外,手动运行svscanboot似乎会立即终止(如果我在后台运行,也不会出现在ps aux输出中)。 我错过了什么设置步骤,或者我做错了什么?