灯火互联
管理员
管理员
  • 注册日期2011-07-27
  • 发帖数41778
  • QQ
  • 火币41290枚
  • 粉丝1086
  • 关注100
  • 终身成就奖
  • 最爱沙发
  • 忠实会员
  • 灌水天才奖
  • 贴图大师奖
  • 原创先锋奖
  • 特殊贡献奖
  • 宣传大使奖
  • 优秀斑竹奖
  • 社区明星
阅读:2098回复:0

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

楼主#
更多 发布于:2012-12-22 15:26

作者: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
游客

返回顶部