I have written a logging application in Python that is meant to start at boot, but I\'ve been unable to start the app with Ubuntu\'s Upstart init daemon. When run from the term
Thanks to unutbu's help, I have been able to correct my job. Apparently, these are the only environment variables that Upstart sets (retrieved in Python with os.environ):
{'TERM': 'linux', 'PWD': '/', 'UPSTART_INSTANCE': '', 'UPSTART_JOB': 'greeenlog', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin'}
My program relies on a couple of these variables being set, so here is the revised job with the right environment variables:
# greeenlog
description "I log stuff."
start on startup
stop on shutdown
env DISPLAY=:0.0
env GTK_RC_FILES=/etc/gtk/gtkrc:/home/greeenguru/.gtkrc-1.2-gnome2
script
exec /usr/local/greeenlog/main.pyw > /tmp/greeenlog.out 2>&1
end script
Thank you!