Category Archives: Linux

Understand “upstart”

Upstart是一个基于事件、替换传统的/sbin/init 守护进程的工具。可以用来启动或者停止任务和服务。 通过下面的例子来更好理解upstart。 首先,在/etc/init下新建一个任务文件: sudo vi /etc/init/helloworld.conf 输入以下内容: #!upstart description “hello world to understand upstart” author “build” start on bounce script export HELLOWORLD=”Hello World!” echo $HELLOWORLD 2>&1 >> /var/log/helloworld.log end script 运行如下命令: sudo initctl emit bounce 察看log文件,确认”Hello World!”已经被打印在该文件中: vi /var/log/helloworld.log … Continue reading

Posted in Linux | Leave a comment