Linux下设置开机自动启动任务

来源:互联网 发布:网络应急预案流程图 编辑:程序博客网 时间:2024/06/08 09:16

1、涉及文件
etc/rc.local

2、在该文件添加你所需要的启动任务即可。注意,任务执行顺序未作测试

3、样本如下, 以以为启动ngnix与tomcat样例

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

启动ngnix

/mnt/tengine/tengine-2.1.2/sbin/nginx

启动tomcat

/mnt/tomcat7/bin/startup.sh &> /dev/null

启动redis

/usr/local/redis/bin/redis-server /usr/local/redis/redis.conf

启动 mongodb

/mnt/mongodb/mongodb-3.2.10/bin/mongod -f /etc/mongodb.conf

原创粉丝点击