PDA

View Full Version : autostart trouble


b0unc3
03-19-2010, 02:33 PM
Hi,

I have a little troubles using autostart to let my application starts automatically.
If I read correctly the autostart documentation the only thing I need to do is to write a script in /etc/event.d/ directory, and I've doing it so :


respawn
console none

start on started xsession
stop on stopping shutdown

exec /usr/bin/myapp



after that I rebooted, but the app still doesn't run automatically. By executing initctl list, I see my script in that list so I try initctl start myscript
there is the output:


myscript (start) waiting
myscript (start) starting
myscript (start) pre-start
myscript (start) spawned, process 2194
myscript (start) post-start, (main) process 2194
myscript (start) running, process 2194



The output seems quite good but, by running a ps I didn't see such a PID and my app is not running.
Any hint will be appreciated ;)

VDVsx
03-19-2010, 03:00 PM
Try this:


respawn
console none

start on started xsession
stop on stopping shutdown

script
exec /usr/bin/myapp
end script


Note that can be a problem in your app, if it is crashing upstart might kick it and ignore the respawn flag.

b0unc3
03-20-2010, 01:19 PM
Try this:


respawn
console none

start on started xsession
stop on stopping shutdown

script
exec /usr/bin/myapp
end script


Note that can be a problem in your app, if it is crashing upstart might kick it and ignore the respawn flag.

Yes, there was a problem in my app that segfaults somewhere (especially when called by upstart) :(
Once I fixed it , upstart started working correctly.