Script de init de unicornio - no empezando en el arranque
-
16-11-2019 - |
Pregunta
Soy muy nuevo en la administración del sistema y no tengo idea de cómo funciona init.d.Así que tal vez estoy haciendo algo mal aquí.
Estoy tratando de comenzar unicornio en el arranque, pero de alguna manera simplemente no se comienza cada vez.Soy capaz de hacer un inicio manualmente / detener / reiniciar por Simply Service App_Name Start.Parece que no puede entender por qué Unicorn no se inicia en el arranque si el inicio de la parada de servicios de servicio manual.¿Algún problema de permiso de usuario tal vez ??
My Unicorn init Script y los archivos de configuración de Unicorn están disponibles aquí https://gist.github.com/1956543
Estoy configurando un entorno de desarrollo en Ubuntu 11.1 corriendo dentro de una máquina virtual.
Solución
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.
Otros consejos
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'