Gentoo添加开机自动启动命令

本文介绍了在Gentoo系统中如何通过在/etc/local.d目录添加运行脚本来实现开机自动启动命令。系统启动时会执行该目录下以.start结尾的脚本,而关闭时则运行以.stop结尾的脚本。文中以创建wpa.start文件启动无线网络配置为例,强调了脚本需要有运行权限,并提示应避免放置耗时过长的脚本以防止影响开机和关机速度。
摘要由CSDN通过智能技术生成

Gentoo的开机自动启动命令可以写在桌面系统的config里。例如,使用i3,可以在.config/i3/config中添加exec命令行来进行开机自动启动。但是,当执行root权限的命令时,桌面系统是无法执行的。Gentoo继承了许多Linux自动启动的方式。下面介绍一个较为简单的方法。

在/etc/local.d目录添加运行脚本

在/etc/local.d目录下有一个README文件,上面详细描述了该目录的使用方法。

This directory should contain programs or scripts which are to be run                                     
when the local service is started or stopped.                                                             
                                                                                                          
If a file in this directory is executable and it has a .start extension,                                  
it will be run when the local service is started. If a file is                                            
executable and it has a .stop extension, it will be run when the local                                    
service is stopped.                                         
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值