ubuntu_service怎么写启动rails

系统自带很多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

+

=

-

*

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值