CentOS开机自启动

CentOS 配置的开机自启动。

vim /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 never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
ip route add default via 192.168.1.1 dev eth0
/opt/product/zookeeper/node-03/bin/zkServer.sh start
/opt/product/activemq/node-03/bin/activemq start
redis-server /etc/redis.conf
/opt/product/mongodb/bin/mongod --port 25019 --dbpath /data/db/ &
/opt/product/dubbo-admin-tomcat/bin/startup.sh
原文地址:https://www.cnblogs.com/zihanxing/p/6882777.html