linux 开机自启

cd /home/dpf

1.vi startup.sh

#!/bin/sh
echo "hello world" >> /home/dpf/test.txt
 
vi mqtt.sh

#!/bin/sh
/home/dpf/Desktop/Udp_Single_Async_Mqtt_yuan/hwjc_udp_receive_mqtt &

2.cd /etc/rc.d/rc.local

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
/home/dpf/mqtt.sh &
/home/dpf/startup.sh


posted @ 2017-11-24 18:49  丁培飞  阅读(164)  评论(0编辑  收藏  举报