views:

28

answers:

1

Suppose I have a script in

/home/myuser/go.py

How do I run that script, when a new instance is booted? (I'm used to using the point-and-click control panel Amazon has...)

+1  A: 

I'm gonna try my nonexistent Linux skills here - create a shell script that runs your go.py and add a symlink to the shell script in /etc/init.d/

/home/myser/go.sh

#!/bin/bash
python /home/myuser/go.py

symlink

ln -s /etc/init.d/go.sh /home/myuser/go.sh

After reading up a bit myself, /etc/rc.local is probably a better place for this. Just edit it and add /home/myuser/go.sh there (again, make sure your go.sh is executable).

Lauri Lehtinen
If I put it in init.d/, then will it start when the server instance is booted?
TIMEX
That's my understanding at least ;-) Make sure it's executable (i.e. `chmod a+x /etc/init.d/go.sh`)
Lauri Lehtinen