如何在Ubuntu中自启一些应用

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/UbuntuTouch/article/details/87182904

我们可以找到如下的地址的文件:

/etc/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.

(sleep 20
python3 /home/liuxg/sensortag/bluepy/bluepy/sensordata.py) &

这里,我们先等待20秒,比如我们需要等待网路已经连接好了,我们再启动我们的服务。再直接运行我们的应用。

猜你喜欢

转载自blog.csdn.net/UbuntuTouch/article/details/87182904
今日推荐