linux启动后执行脚本(/etc/rc.local文件)

来源:互联网 发布:淘宝怎么注册品牌 编辑:程序博客网 时间:2024/06/04 18:15

linux下有一个/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.

改文件的作用是,在所有系统初始化脚本执行完毕后,执行该命令脚本。因此,一些系统初始化的命令,可以放在这个文件中

比如LNMP的启动,避免机器故障重启后服务器忘记启动而导致的故障

0 0
原创粉丝点击