Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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'm want to execute the script once the machine is up and running. Basically running "groovy /scripts/myscript.groovy".

No need for it to be a service or to re-run the script in case it's stopped!

2 questions:

  • Where should I put that call? rc.local? init.d? excuse my ubuntu (lack of) skills.
  • Is there a way I can test it other than restarting the machine? (Amazon EC2)


share|improve this question
up vote 0 down vote accepted

lYou right, you have to create a new line on rc.local or create a script (start/stop/restart/status) in /etc/init.d/myscript.

Ex on rc.local call :

#!/bin/sh -e
# rc.local
# ....
/path/to/groovy /path/to/your/scripts/myscript.groovy
exit 0

And about boot, you can have all informations on /var/log/boot.log on each boot. On try uptime to test the uptime of your server. Or add one more rc.local line to call a script who warn you by mail if the server boot, etc. There is many possibilities, depending of your needs.

share|improve this answer

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.