Search code examples
ruby-on-railsrubyubuntuunicornubuntu-11.10

Unicorn init script - not starting at boot


I'm very new to system administration and have no idea how init.d works. So maybe I'm doing something wrong here.

I'm trying to start unicorn on boot, but somehow it just fails to start everytime. I'm able to manually do a start/stop/restart by simply service app_name start. Can't seem to understand why unicorn doesn't start at boot if manual starting stopping of service works. Some user permission issue maybe ??

My unicorn init script and the unicorn config files are available here https://gist.github.com/1956543

I'm setting up a development environment on Ubuntu 11.1 running inside a VM.

UPDATE - Could it be possible because of the VM ? I'm currently sharing the entire codebase (folder) with the VM, which also happens to contain the unicorn config needed to start unicorn.

Any help would be greatly appreciated !

Thanks


Solution

  • 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.