Unicorn Init脚本 - 未启动启动
-
16-11-2019 - |
题
我是非常新的系统管理,不知道init.d如何工作。所以也许我在这里做错了。
我正在尝试在启动时开始独角兽,但不知何故,它每次都无法启动。只需stails app_name start,我就可以手动执行开始/停止/重新启动。如果手动启动服务工作,似乎似乎无法理解为什么Unicorn在启动时无法启动。某些用户权限问题可能??
我的Unicorn Init脚本和Unicorn Config文件可在这里 https:/gist.github.com/1956543
更新 - 可能因为VM可能是可能的吗?我当前正在使用VM共享整个代码库(文件夹),这也恰好包含启动Unicorn所需的Unicorn Config。
解决方案
To get Unicorn to run when your system boots, you need to associate the init.d script with the default set of "runlevels", which are the modes that Ubuntu enters as it boots.
There are several different runlevels, but you probably just want the default set. To install Unicorn here, run:
sudo update-rc.d <your service name> defaults
For more information, check out the update-rc.d man page.
其他提示
You can configure a cron job to start the unicorn server on reboot
crontab -e
and add
@reboot /bin/bash -l -c 'service unicorn_<your service name> start >> /<path to log file>/cron.log 2>&1'