Create rc.local in Fedora

本文介绍如何配置 rc.local 脚本来实现系统的自定义启动任务。管理员可以通过创建并设置该文件为可执行的方式,在系统启动时运行特定的脚本。文章详细解释了设置步骤,包括添加必要的 shebang 行及确保脚本正确结束。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


The /etc/rc.d/rc.local local customization script is no longer included by default. Administrators who need this functionality merely have to create this file, make it executable, and it will run on boot. Upgrades are not affected by this change.

# touch /etc/rc.d/rc.local

Is your rc.local executable? if not make it executable

# chmod a+x /etc/rc.d/rc.local

Be also sure to add at the very top of the file the shebang line:

#!/bin/sh

another thing you should be sure of is to add a trailing line like this:

exit 0

because the booting process always expects this script to end successfully and return a 0 exit value.



from : http://forums.fedoraforum.org/showthread.php?t=291889
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值