Important: Please read the Qt Code of Conduct -

Reg: Qt application at start-up in Linux

  • Hi All,
    I have developed a QT application. i want to this application to start after booting, before login. I dont want the desktop...

    I tried the following..
    added my file to /etc/profile and /etc/rc.d/rc.local... but didnt succeed..

    i coped my script to /init.d

    added below line to rcS
    echo Program Starting

    my script file
    echo Program Starting
    insmod /g_webcam.ko
    insmod /uvcvideo.ko
    export VSALPHA=1
    chmod a+x /root/user/my_qt_prog
    ./root/user/my_qt_prog -qws

    While linux booting i get the following message
    Program Starting
    Program Starting
    g_webcam gadget: uvc_function_bind
    g_webcam gadget: Webcam Video Gadget
    g_webcam gadget: g_webcam ready
    But QT program is not running.....*

    Kindly point out my mistake and share your suggestions

    Thanks in Advance

  • Lifetime Qt Champion


    Just to be sure, are you trying to run a Qt gui for embedded linux on a desktop system with X11 installed ?

  • Embedded Linux...

  • Moderators


    Have you made sure that your Qt Application is able to resolve all the required dependencies before login ?

  • Lifetime Qt Champion

    Also, what distribution are you using ?

  • Hi,
    "Qt Application is able to resolve all the required dependencies before login"

    can you be lilttle more specific abt wat u meant??
    i am a newbie....

    I am using Linux Distribution from Freescale. kernel 3.0.35

    And i need to login in my embedded linux to start working in it.. does it mean i have to add login details in my script or??

  • Moderators

    I mean that your Qt Application requires Qt libraries and Qt libs itself depends on other libraries and also maybe you have linked to other third party libraries.

    You can check that by using the ldd utility.

    Just edit your script and ldd to your executable and redirect output to a file.

    For e.g. from your script
    Add this
    ldd /root/user/my_qt_prog > /root/deps

    before calling

    ./root/user/my_qt_prog -qws

    Then check in the "deps" file for any missing dependency or paste its contents here.

  • ldd /root/user/my_app > /root/deps
    -sh: ldd: not found

    ldd utility is not available in my distribution....

  • Moderators

    Try this
    LD_TRACE_LOADED_OBJECTS=1 /root/user/my_app > /root/deps

  • => /usr/lib/ (0x2aba2000) => /usr/lib/ (0x2b460000) => /usr/lib/ (0x2b566000) => /usr/lib/ (0x2b80b000) => /usr/lib/ (0x2aad1000) => /usr/lib/ (0x2aaef000) => /usr/lib/ (0x2ab09000) => /usr/lib/ (0x2b8df000) => /usr/lib/ (0x2ab88000) => /usr/lib/ (0x2b924000) => /usr/lib/ (0x2b993000) => /usr/lib/ (0x2b9d1000) => /lib/ (0x2ab14000) => /lib/ (0x2ba94000) => /lib/ (0x2bb42000) => /lib/ (0x2aab6000) => /lib/ (0x2bbb3000) => /lib/ (0x2ab92000) => /lib/ (0x2bcda000)
    /lib/ (0x2ab60000)

  • Moderators

    Well as per the output all deps are resolved. But is it before login ?
    As you said you want to launch app before login.

    bq. i want to this application to start after booting, before login

  • Hi,
    My exact requirment is:
    i doesnt want the desktop to show... i want my qt application to be the only screen after the system boots...
    but wen the system boots it requests for login and password..
    so i thought its better to launch before login!!!!

    wat can i do to make my qt application launch without showing the desktop??? can you advice plz

  • Lifetime Qt Champion

    If your system is debian based, there's a startup script example that you can use to correctly start your application.

    You also need to launch it from the correct run level.

    On a side note, the correct place for applications is /usr/bin not /root/

  • My distribution is Linux freescale 3.0.35, ubuntu oneiric.
    Can you share the details about the start-up script!!!

  • Lifetime Qt Champion

    Less exclamation mark please

    "Ubuntu boot up howto": gives some explanation.

    "Debian administration": also

  • Hi,
    After booting the OS requests for login and password... is there a way to do autologin ???
    i cannot use keyboard in my embedded device...

Log in to reply