![]() |
How to autostart application at boot?
Hi,
I am struggling now for over 12 hours with a problem of starting my application after the boot. I have created scripts and saved them in following locations: /etc/init.d/imhere /etc/init.d/imhere_run_later then I have used "ln -s" command to create a link to /etc/init.d/imhere from /etc/rc2.d/S99imhere Unfortunately my application did not start. I started playing around with those files in init.d and finally ended up with following: /etc/init.d/imhere: Code:
#!/bin/shCode:
echo "ENTERED RUN_LATER" >> /home/user/startuplogI have modified also /etc/init.d/hulda by adding at the beggining of the file following piece of code: Code:
echo "HULDA INIT" >> /home/user/startuplogIf I run myself the script /etc/init.d/imhere from terminal, the startuplog file will fill up with "SLEPT..." and the other echoed text as expected and /usr/bin/imhere starts running. Question is: Why my own scripts are not called/executed at startup? Thanks in advance. |
Re: How to autostart application on boot?
|
Re: How to autostart application on boot?
Thanks, that was a very good advice. Indeed maemo uses upstart.
I have checked the post about batlevel and it helped a lot, finally my script starts at the startup time. Now, I see I have some other problems also. I want to start a Qt application and show the window to the user, the problem is, that the application does not want to start(is terminated?), though I have no problems to run it from applications menu or the command line. I have heard, that I should split my code to 2 applications ( non graphical daemon, and the window app), but I would prefer having only one. Any ideas? |
Re: How to autostart application on boot?
what app is it that you are trying to start ?
how do you start it ? could you provide more details then somebody or myself could try and help, there isnt much info you have provided :) ? |
Re: How to autostart application on boot?
I am developing my own application, that listens to text messages and then executes different kind of actions depending on the text given in the message.
Usually the application runs hidden in the background, but it might be woken up (shown in FullScreen) by certain commands in the text messages. The application is ready and working if it has been run after the reboot, but it does not want to start during startup. Here is the main.cpp: Code:
#include <QApplication> |
Re: How to autostart application on boot?
what does your startup script in the event.d look like ?
and are you starting the above app in the startup file ? do you see any error/trace ? or does the app not start at all ? |
Re: How to autostart application on boot?
I know nothing about Upstart, so all I can do is give lame hints.
You may need the D-Bus initialization routines from http://talk.maemo.org/showpost.php?p...9&postcount=16 and, also, have you tried making it start when hildon-desktop has done so? I believe it's something like "start on started hildon-desktop" (alternatively, "start on started xsession" may work for you) in your Upstart service definition. |
Re: How to autostart application on boot?
This is my /etc/event.d/imhere:
Code:
description "Starts the imhere application"Code:
#!/bin/shCode:
MHERE INIT CALLED |
Re: How to autostart application on boot?
Quote:
I have tried to run my application from a init.d script inlcuding: Code:
echo "SOME TEXT"I have checked with ps -A | grep imhere from terminal |
Re: How to autostart application on boot?
Code:
start on started hildon-desktop |
Re: How to autostart application on boot?
Tried, didn't help... :(
|
Re: How to autostart application on boot?
Hi,
try to put some printf in the application itself, there will be something that crash (maybe). |
Re: How to autostart application on boot?
Quote:
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) |
Re: How to autostart application on boot?
Quote:
|
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-desktopCode:
start on started hildon-desktopCode:
#!/bin/sh |
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).
|
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. |
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
|
Re: How to autostart application on boot?
Actually, it is doing that already :)
|
Re: How to autostart application on boot?
this should also work
Quote:
Quote:
|
| All times are GMT. The time now is 22:24. |
vBulletin® Version 3.8.8