Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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)

Thanks!

share|improve this question

1 Answer 1

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

 
discard

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.