嵌入式爱好者

8MM自启QT界面程序

2020-12-30 14:59| 发布者: djh| 查看: 2098| 评论: 0

类目: 知识库  >  i.MX8MM系列产品     文档编号: 451


vi  /etc/init.d/matrix-gui-2.0

修改为如下内容

红色字体为添加内容,即启动指令,此例是启动 /usr/bin/qt5/下的network

 

#! /bin/sh

 

matrixgui="/usr/bin/matrix_browser"

GUI_OPTS="http://127.0.0.1:80/ """

PIDFILE="/var/run/matrix-gui-2.0.pid"

 

# Important System Environment Variables

for sh in /etc/profile.d/*.sh ; do

    [ -r "$sh" ] && . "$sh"

Done

//此处加几秒延时(sleep *

 sleep 3

 /usr/bin/qt5/network

itest -x "$matrixgui" || exit 0

case "$1" in  start)

 

    #Clear out the the tmp and lock directory

    cd /usr/share/matrix-gui-2.0

   rm -rf tmp/*

    rm -rf lock/*

    cd -

 

      if [ -e $PIDFILE ]; then

      PIDDIR=/proc/$(cat $PIDFILE)

      if [ -d ${PIDDIR} -a  "$(readlink -f ${PIDDIR}/exe)" = "${matrixgui}" ]; then

        echo "$DESC already started; not starting."

    else

        echo "Removing stale PID file $PIDFILE."

      rm -f $PIDFILE

      fi

    fi

 

    echo -n "Starting Matrix GUI application"

    start-stop-daemon --start --quiet --background -m --pidfile $PIDFILE --exec $matrixgui -- $GUI_OPTS

    echo "."

   ;;

 

  stop)

    echo -n "Stopping Matrix GUI application"

    start-stop-daemon --stop --quiet --pidfile $PIDFILE

   echo "."

    ;;

  *)

    echo "Usage: /etc/init.d/matrix-gui-2.0 {start|stop}"

exit 1

esac

exit 0

保存退出

reboot即可完成自启


已解决

未解决
1

只是看看

刚表态过的朋友 (1 人)

最新评论

QQ|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )

GMT+8, 2024-9-8 07:33

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

返回顶部