系统自带很多service,我们也可以安装很多,比如:
sudo service mysql start
这里的mysql就是系统的一个服务,但不仅仅是个sh脚本。
Take a look at /etc/init.d/skeleton for an example, and the others in that directory.
/etc/init.d/skeleton
这个脚本挺好的,就是个写作范例和模版。
It might help if you looked into how the init.d scripts worked which would give you a better understanding of what's going on.
https://help.ubuntu.com/community/UbuntuBootupHowto
http://www.cyberciti.biz/tips/linux-...p-service.html
如果需要的话,这两篇文章真是不错的指引了~
如果是做RoR的,可以参考这里:
Starting a Rails instance automatically on boot on Ubuntu Server
可惜这里还是有问题,手动设置PATH很不妥么。
改成这样类似的就不错了:
sudo -u www -i /my/path/to/my/script
P
+
=
(
-
*