goback add

让你的程序在linux开机时自动启动

2690 点击·0 回帖
灯火互联
楼主

作者:noodle_bear
如何让你的程序在linux开机时自动启动
 
 
 
只需要在/etc/rc.local里添加你的程序即可,例如需要nginx服务在每次开机时
 
自动运行则可以加入如下的配置,添加最后一行/usr/local/nginx/sbin/nginx即可


#!/bin/sh
 
#
 
# This script will be executed *after* allthe other init scripts.
 
# You can put your own initialization stuff inhere if you don't
 
# want to do the full Sys V style initstuff.
 
 
 
touch/var/lock/subsys/local
 
/usr/local/nginx/sbin/nginx


喜欢0 评分0