首页 > 代码库 > 在 beaglebone black 开机启动自己的QT程序

在 beaglebone black 开机启动自己的QT程序

在 beaglebone black上的Linux系统 开机启动自己的QT程序

把自己编译好的mycomtest程序放在/usr/bin/qtopia/myproject 

看/etc/init.d下有没有rc.local,没有的话,创建一个,有的话,就在里面直接的exit 0前添加 /usr/bin/qtopia/myproject /mycomtest -qws & ,开机就能启动。

我的机子里没有rc.local文件,则有以下步骤:


#touch /etc/init.d/rc.local


#chmod +x /etc/init.d/rc.local


#vi /etc/init.d/rc.local


#ln -sf /etc/init.d/rc.local /etc/rc0.d/K999rc.local 


#ln -sf /etc/init.d/rc.local /etc/rc1.d/K999rc.local 


#ln -sf /etc/init.d/rc.local /etc/rc2.d/S999rc.local 


#ln -sf /etc/init.d/rc.local /etc/rc3.d/S999rc.local 


#ln -sf /etc/init.d/rc.local /etc/rc4.d/S999rc.local 


#ln -sf /etc/init.d/rc.local /etc/rc5.d/S999rc.local 


#ln -sf /etc/init.d/rc.local /etc/rc6.d/K999rc.local




/etc/init.d/rc.local的内容为:


#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.



/usr/bin/qtopia/myproject /mycomtest -qws &
exit 0


结果:开机自启动成功。