Linux開機自動啓動軟件/可執行程序方法-一個示例

/etc/rc.d/rc.local

#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.

touch /var/lock/subsys/local
rmmod ixgbe
modprobe ixgbe allow_unsupported_sfp=1
service network restart
cd /opt/dpdk-16.11/tools
./bind.sh

#開機啓動
at now+1 minutes < /root/mybash.sh &

/root/mybash.sh

#!/bin/bash
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/some/path

echo Start OM `date` >> /root/mybash.start

cd /my/execution/path
(nohup /my/execution/path/exe 1>/root/mybash.log 2>&1 &)
cd -

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章