This is the script, /home/jack/myscript.sh, which I want to run:
export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.26/
/home/jack/myapp/apache-tomcat-6.0.32/bin/./catalina.sh run
The upstart file, /etc/init/myapp.conf, that I have written:
description "Myapp Server"
start on runlevel [2345]
stop on runlevel [06]
respawn
respawn limit 10 5
exec `su jack -c /home/jack/myscript.sh`
So, if I want to run the script as user jack, would my above configuration work? Is there a better way of doing it?