I’m using Ubuntu Server and I have a rails application. I want to start the rails server on the boot. I’ve already put the files on the /etc/init.d/ and also I’ve created a crontab with the command:
cd ~/myapp/
nohup rails s -p 8000 &
I’ve already used Puma Server(https://github.com/puma/puma/) but I cannot start the server. If I execute the script manually, so the server started perfectly. I don’t know how it is happening. Someone has been passed something similar to this?
You have to create a link to the /etc/rc2.d/ directory like this:
Because /etc/init.d/ is the place where starter scripts are stored but the /etc/rc2.d/ folder is the one which contains the scripts that are executed when starting up. By using S_name.sh you say via the number at which position a script is runned. The higher the number the later it is executed.