This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/am3351: Qt application service file

Part Number: AM3351

Tool/software: Linux

i created and enable service file, it was started i got    log message( [  OK  ] Started SystemConsoleApplication. )

but i dint get my qt app & hellow world log.

please check below process.

vi /lib/systemd/system/sysconsole_app.service
[Unit]
Description=SystemConsoleApplication
Before=serial-getty@ttyO2.service

[Service]
ExecStart=/bin/sh /home/root/sysconsole_app.sh
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target

vi /home/root/sysconsole_app.sh

echo Hello World!
/home/Colors -platform linuxfb:/dev/fb0 http://localhost:80 &

chmod 644 /lib/systemd/system/sysconsole_app.service

chmod 755 /etc/init.d/1sysconsole_app.sh

systemctl daemon-reload

systemctl enable sysconsole_app.service

  • status log:
    systemctl status sysconsole_app.service

    [[0;1;31m●[[0m sysconsole_app.service - SystemConsoleApplication
    Loaded: loaded (/lib/systemd/system/sysconsole_app.service; enabled; vendor preset: enabled)
    Active: [[0;1;31mfailed[[0m (Result: exit-code) since Mon 2018-02-05 15:57:14 UTC; 1min 49s ago
    Main PID: 392 (code=exited, status=203/EXEC)

    Feb 05 15:57:13 am335x-evm systemd[1]: Started SystemConsoleApplication.
    Feb 05 15:57:13 am335x-evm systemd[392]: [[0;1;31msysconsole_app.service: Failed at step EXEC spawning /etc/init.d/1sysconsole_app.sh: Exec for
    mat error[[0m
    Feb 05 15:57:14 am335x-evm systemd[1]: [[0;1;39msysconsole_app.service: Main process exited, code=exited, status=203/EXEC[[0m
    Feb 05 15:57:14 am335x-evm systemd[1]: [[0;1;39msysconsole_app.service: Unit entered failed state.[[0m
    Feb 05 15:57:14 am335x-evm systemd[1]: [[0;1;39msysconsole_app.service: Failed with result 'exit-code'.[[0m
    Feb 05 15:57:57 am335x-evm systemd[1]: [[0;1;39m[/lib/systemd/system/sysconsole_app.service:7] Unknown lvalue 'Before' in section 'Service'[[0m

    Feb 05 15:57:57 am335x-evm systemd[1]: [[0;1;39m[/lib/systemd/system/sysconsole_app.service:8] Unknown lvalue 'StandardOutpuv' in section 'Serv
    ice'[[0m
  • Hi,

    Can you add /bin/sh as follows,

    #!/bin/sh
    echo Hello World!

    to your script ?
  • Hi thanks for your support.
    i got hellow world but my qt app is not running please check below

    file:
    vi /home/root/1sysconsole_app.sh

    #!/bin/sh
    echo "********************Hello World!"
    /home/root/Colors -platform linuxfb:/dev/fb0 http://localhost:80 &

    log:
    Starting rc.pvr.service...
    [ 29.955069] sh[412]: ********************Hello World!
    Starting Login Service...
    [ OK ] Started Network Name Resolution.
    [ OK ] Started Permit User Sessions.
    [ OK ] Started rc.pvr.service.
    Starting telnetd.service...
    [ OK ] Started Getty on tty1.
    [ OK ] Started Serial Getty on ttyS0.
    [ OK ] Started Serial Getty on ttyS3.
    [ OK ] Started telnetd.service.
    [ OK ] Started Login Service.
    Starting thttpd.service...
    [ OK ] Started thttpd.service.
    Starting thermal-zone-init.service...
    [ OK ] Started thermal-zone-init.service.
    Starting gplv3-notice.service...
    [ OK ] Started gplv3-notice.service.
  • What do you get in the systemctl status ?
  • ● sysconsole_app.service - SystemConsoleApplication
    Loaded: loaded (/lib/systemd/system/sysconsole_app.service; enabled; vendor preset: enabled)
    Active: inactive (dead) since Mon 2018-02-05 15:57:15 UTC; 11min ago
    Main PID: 395 (code=exited, status=0/SUCCESS)

    Feb 05 15:57:13 am335x-evm systemd[1]: Started SystemConsoleApplication.
  • Have you tried running the script in standalone, instead from systemD, did it run ? Can you check and change the permission of the /home/Colors -platform as you did for the script. Also check & is being passed as an option and hence the executable fails
  • Hi Dwarakesh, thanks for your great support.
    issue fixed with below script.

    vi /etc/init.d/1sysconsole_app.sh

    #!/bin/sh
    # Important System Environment Variables
    SCRIPTS=/etc/profile.d/*.sh
    for f in $SCRIPTS
    do
    source $f
    done

    echo "********************Hello World!"
    /home/root/Colors -platform linuxfb:/dev/fb0 http://localhost:80


    thank you.