欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Linux开机自动启动软件/可执行程序方法-一个示例

程序员文章站 2022-07-14 13:15:52
...

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

 

相关标签: GNU/Linux