Results 1 to 9 of 9

Thread: Qt app in linux startup

  1. #1
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Qt app in linux startup

    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

  2. #2
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt app in linux startup

    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 ...
    "Behind every great fortune lies a crime" - Balzac

  3. #3
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Qt app in linux startup

    DO any one have sample scripts, any examples, any links for the above details..

  4. #4
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt app in linux startup

    hey ... a simple linux script to run your qt application ... its very easy ...
    "Behind every great fortune lies a crime" - Balzac

  5. #5
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Qt app in linux startup

    i am new to this.
    could you give me some sample script.

  6. #6
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt app in linux startup

    alright here goes ...


    Qt Code:
    1. #!/bin/sh
    2.  
    3. USAGE="usage: $0 {start|stop}";
    4.  
    5. usage() {
    6. echo $USAGE >&2
    7. }
    8.  
    9. ss_start() {
    10. cd /usr/local/qtsoft/bin
    11. ./my_qt_app &
    12.  
    13. }
    14.  
    15. ss_stop() {
    16. killall -9 my_qt_app
    17.  
    18. }
    19.  
    20. case $1 in
    21. start) ss_start ;;
    22. stop) ss_stop ;;
    23. *) usage
    24. exit 1
    25. ;;
    26. esac
    To copy to clipboard, switch view to plain text mode 
    "Behind every great fortune lies a crime" - Balzac

  7. #7
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt app in linux startup

    so to start your script just run "script_name.sh start" in the console ...
    "Behind every great fortune lies a crime" - Balzac

  8. #8
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Qt app in linux startup

    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

  9. #9
    Join Date
    Oct 2009
    Posts
    151
    Thanks
    6
    Thanked 13 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt app in linux startup

    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.

Similar Threads

  1. QT Creator crashed on startup
    By eloos in forum Qt Tools
    Replies: 13
    Last Post: 20th November 2009, 08:50
  2. Replies: 1
    Last Post: 15th January 2009, 07:47
  3. Switching between console and GUI on startup
    By EricF in forum Qt Programming
    Replies: 4
    Last Post: 10th January 2008, 19:03
  4. How to get empty mainwidget at startup
    By Morea in forum Qt Tools
    Replies: 1
    Last Post: 10th March 2006, 22:32
  5. QToolBar go away! On startup anyway.
    By bitChanger in forum Qt Programming
    Replies: 1
    Last Post: 10th February 2006, 18:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.