maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   How to autostart application on boot? (https://talk.maemo.org/showthread.php?t=50094)

rachol 2010-04-15 15:21

Re: How to autostart application on boot?
 
Tried, didn't help... :(

b0unc3 2010-04-15 15:22

Re: How to autostart application on boot?
 
Hi,

try to put some printf in the application itself, there will be something that crash (maybe).

rachol 2010-04-15 16:12

Re: How to autostart application on boot?
 
Quote:

Originally Posted by b0unc3 (Post 612040)
Hi,

try to put some printf in the application itself, there will be something that crash (maybe).

Thx,

I have followed your advice, that brought me a bit closer to the soulution.

It crashes/quits/terminates in following line:
Code:

QApplication app(argc, argv)
Now this stuff gets tricky, it seems, that some environment variables or something like that are not set when the application is executed

krk969 2010-04-15 16:21

Re: How to autostart application on boot?
 
Quote:

Originally Posted by rachol (Post 612117)
It crashes/quits/terminates in following line:
Code:

QApplication app(argc, argv)
Now this stuff gets tricky, it seems, that some environment variables or something like that are not set when the application is executed

strange, but have you tried running with run_standalone.sh <your app> ?

rachol 2010-04-15 16:54

Re: How to autostart application on boot?
 
Hi,

I have got it working, thx to krk969 again :)

I have no idea of the reason why, but following file /etc/event.d/imhere didn't work:
Code:

start on started hildon-desktop
script
        run-standalone.sh /usr/bin/imhere
end script

So I tried to change it to:
Code:

start on started hildon-desktop
exec /etc/init.d/imhere start
stop on starting shutdown

Then I have edited /etc/init.d/imhere file to:
Code:

#!/bin/sh

case "$1" in
  start)
    run-standalone.sh /usr/bin/imhere
        ;;
  *)
esac

exit 0

And surprise, surprise it works!! Great! Thank you all, soon(day or two) I will upload an intresting app in extras-devel :)

tuminoid 2010-04-15 18:19

Re: How to autostart application on boot?
 
AFAIK your problem is trying to start Qt GUI app as root, which isn't gonna work as root cannot connect to X. This is demonstrated by segfault in QApplicatio init. For GUI app I'd suggest starting your app in Xsession, with su - user -c "/path/to/app" (cannot test exact syntax as posting this on the road).

rachol 2010-04-15 18:47

Re: How to autostart application on boot?
 
Just checked from curiosity,

su user -c "path" does not work in my case, I have just checked all the possible syntax combinations, none of them worked.

root does not have access to X? it somehow does not sound right... I thought root have access to anything :)

Anyway, I have been running qt applications as a root hundreds of times, it works.

Thanks anyway for a tip.

festivalnut 2010-04-15 18:57

Re: How to autostart application on boot?
 
i'm liking the sounds of this interesting app! any teasers? like if i receive a text with the phrase "i want sex" it will auto-reply "be there in ten mins" and set the satnav to the senders adress? :P

rachol 2010-04-15 18:58

Re: How to autostart application on boot?
 
Actually, it is doing that already :)

PeroMed 2010-07-29 10:55

Re: How to autostart application on boot?
 
this should also work

Quote:

start on started hildon-desktop
exec run-standalone.sh /usr/bin/imhere start
stop on starting shutdown
and if you want to run it as user not root:


Quote:

start on started hildon-desktop
exec run-standalone.sh su user -c /usr/bin/imhere start
stop on starting shutdown


All times are GMT. The time now is 22:24.

vBulletin® Version 3.8.8