Laravel  
laravel
文档
数据库
架构
入门
php技术
    
Laravelphp
laravel / php / java / vue / mysql / linux / python / javascript / html / css / c++ / c#

linux rc.local

作者:傲世,小狂徒   发布日期:2026-04-11   浏览:83

#!/bin/bash
# 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

# Example commands:
# Start a network service
#/sbin/service network start

# Run a custom script
#/path/to/your/script.sh

# Mount a network drive
#mount -t cifs //server/share /mnt/share -o username=user,password=pass

# Ensure the firewall is started
#/sbin/service firewalld start

exit 0

解释说明:

  • rc.local 文件是一个在系统启动时执行的脚本,通常位于 /etc/rc.local
  • 这个脚本会在所有其他初始化脚本之后执行,因此可以用来运行一些自定义的命令或脚本。
  • 上面的示例代码中包含了一些常见的命令和注释,你可以根据需要添加或修改这些命令。
  • 最后一行 exit 0 表示脚本成功执行完毕。

上一篇:linux解压rar压缩包

下一篇:linux popen

大家都在看

linux常用命令查询端口是否正常

linux 发送邮件

linux长ping命令

linux groupadd

linux关机命令行

linux 安装 gcc

linux重启oracle命令

linux把一个文件夹移动到另一个文件夹里

linux查看系统运行时间

linux搭建sftp

Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3

Laravel 中文站