1

I have an Amazon Ubuntu instance which I stop and start (not terminate). I was wondering if it is possible to run a script on start and stop of the server. Specifically, I am looking at writting a python boto script to take my RDS volume offline when the EC2 server is not running.

Can anyone tell me if this is possible please?

Jimmy
  • 12,087
  • 28
  • 102
  • 192

1 Answers1

1

It is possible. You just have to write an init script and setup proper symbolic links in /etc/rc#.d directories. It will be started with a parameter start or stop depending on if machine is starting up or shutting down.

akostadinov
  • 17,364
  • 6
  • 77
  • 85
  • Isnt that only for startup and not shutdown? – Jimmy Feb 19 '13 at 20:00
  • It depends on where do you create the links and how you name them. You can find more info here, I think it is relevant to ubuntu: http://www.debian.org/doc/manuals/debian-reference/ch03.en.html – akostadinov Feb 20 '13 at 12:44