Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to start the RoR application named fedena.

What I generally do is SSH login as rootand hit these commands

root@cloud:~# cd fedena
root@cloud:~/fedena# script/server
=> Booting WEBrick
=> Rails 2.3.5 application starting on
and so on...meaning the app server is running

Then when I close the SSH session, the application ends.

Now,what I figured out was for keeping it alive was to run this shell script through webmin interface and it survived. But, I wanted to autorun this script on every boot/restart. I tried to add


before the exit 0 line in the


Alas ! It didn't work. Why I don't understand.

share|improve this question

Given your script is bash and the path is /root/fedina/server/script you could have:

##!/bin/sh -e
# rc.local
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
# In order to enable or disable this script just change the execution
# bits.
# By default this script does nothing.

bash /root/fedina/server/script

exit 0

Note: Don't forget about the execution bits (eg. chmod a+x /etc/rc.local)

share|improve this answer
I tried bash /location/of/file but it didn't work. Later I realised my script is ruby script. I then did ruby /location/to/file and it worked. Thanks for the execution bit help @andy.holmes – VenomVipes Jun 17 '13 at 6:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.