Unicorn Init Script - nicht beim Booten starten
-
16-11-2019 - |
Frage
Ich bin sehr neu in der Systemverwaltung und habe keine Ahnung, wie init.d funktioniert.Also, vielleicht tue ich hier etwas falsch.
Ich versuche, ein Unicorn beim Booten zu beginnen, aber irgendwie fängt es einfach nicht jedes Mal an.Ich kann manuell einen Start / Stopp / Neustart durch einfacher Service App_name-Start machen.Ich kann nicht verstehen, warum Einicorn beim Booten nicht startet, wenn man manuell beginnt, das Anhalten von Servicearbeiten zu starten.Einige Benutzerberechtigungsausgabe vielleicht ??
Mein Unicorn Init Script und die Unicorn Config-Dateien sind hier verfügbar https://gist.github.com/1956543
Ich erstellte eine Entwicklungsumgebung auf Ubuntu 11.1, die in einem VM läuft.
Lösung
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.
Andere Tipps
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'