PDA

View Full Version : Qt app in linux startup



qtlinuxnewbie
2nd March 2010, 09:38
Hi,

i want to start my qt application automatically when the user logged in.
i am using RHEL 5 server linux.


Could any one have any idea..

thankx in advance..

@qtlinuxnewbie

wagmare
2nd March 2010, 10:00
in /etc/X11/ run your script u can override your application before the desktop came but no window manager ... just go through this init.d .. it will give u clear idea ...


this path /etc/X11/xinit/xinitrc.d/ ... run a script that execute your code ...

qtlinuxnewbie
2nd March 2010, 10:47
DO any one have sample scripts, any examples, any links for the above details..

wagmare
2nd March 2010, 10:56
hey ... a simple linux script to run your qt application ... its very easy ...

qtlinuxnewbie
2nd March 2010, 11:02
i am new to this.
could you give me some sample script.

wagmare
2nd March 2010, 11:06
alright here goes ...



#!/bin/sh

USAGE="usage: $0 {start|stop}";

usage() {
echo $USAGE >&2
}

ss_start() {
cd /usr/local/qtsoft/bin
./my_qt_app &

}

ss_stop() {
killall -9 my_qt_app

}

case $1 in
start) ss_start ;;
stop) ss_stop ;;
*) usage
exit 1
;;
esac

wagmare
2nd March 2010, 11:08
so to start your script just run "script_name.sh start" in the console ...

qtlinuxnewbie
2nd March 2010, 11:22
thnk u very much..

everything was fine.

But when i restart my system and log in.
i am getting the following error: your session only lasted less than 10 sec......
,,,,,
....

actually my task is
when i loggd in .. my app shuld start.
but i am not getting this instead above error.
and not able to loggd in .. when i del the .sh file using failsafe session. i am able to log in


could you guide me ..
thnkz in advance

JD2000
2nd March 2010, 19:37
I normally bung the startup scripts in /etc/init.d/myscript

and run chkconfig to sort out the rc links.

We probably should not be discussing linux booting in this forum though.