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 terminal with sudo /usr/local/greeenlog/main.pyw, the application works perfectly. Here is what I've tried for the Upstart job:
/etc/init/greeenlog.conf
# greeenlog
description "I log stuff."
start on startup
stop on shutdown
script
exec /usr/local/greeenlog/main.pyw
end script
My application starts one child thread, in case that is important. I've tried the job with the expect fork stanza without any change in the results. I've also tried this with sudo and without the script statements (just a lone exec statement). In all cases, after boot, running status greeenlog returns greeenlog stop/waiting and running start greeenlog returns:
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.61" (uid=1000 pid=2496 comm="start) interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply=0 destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init"))
Can anyone see what I'm doing wrong? I appreciate any help you can give. Thanks.
sudo start greeenlog
, does the error message still say(uid=1000 pid=2496 comm="start)
? By the way, I set up a /etc/init/greeenlog.conf as you described, and was successful with the commandsudo start greeenlog
. – Polkamain.pyw
might be crashing when run through upstart. Perhaps try puttingexec /usr/local/greeenlog/main.pyw >/tmp/main.out 2>&1
ingreeenlog.conf
so you can see some error messages. – Polka