Unicorn Initスクリプト - ブートから始めていません
-
16-11-2019 - |
質問
システム管理には非常に新しい、INIT.Dがどのように機能するのかわかりません。だから多分私はここに何か悪いことをしています。
起動時にUnicornを始めようとしていますが、どういうわけかそれはただの時間の起動に失敗しました。service app_name startで手動で開始/停止/再起動を行うことができます。手動でサービスの停止を開始した場合、Unicornが起動時に起動しないのか理解できないようです。いくつかのユーザー許可の問題は多分??
マイユニコーンINITスクリプトとUnicorn設定ファイルは、ここで利用可能です。 https://gist.github.com/1956543
VM内で実行されているUbuntu 11.1に開発環境を設定しています。
更新 - VMのために可能な限り可能ですか?私は現在、Unicornを起動するのに必要なUnicorn Configを含む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'