修改/etc/rc.local脚本
举例:将redis-server添加到启动项
vim /etc/rc.local
/etc/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
echo "hello linux" >> /tmp/hello2.log
influxd > /tmp/influxd.log 2>&1 &
echo "hello linux" >> /tmp/hello3.log
# 将redis-server添加到启动项
sudo /etc/init.d/redis-server restart >> /etc/init.d/redis.log 2>&1 &