惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
MyScale Blog
MyScale Blog
博客园 - 【当耐特】
I
InfoQ
腾讯CDC
aimingoo的专栏
aimingoo的专栏
L
LangChain Blog
人人都是产品经理
人人都是产品经理
D
DataBreaches.Net
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
Vercel News
Vercel News
C
Check Point Blog
B
Blog RSS Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
Y
Y Combinator Blog
D
Docker
MongoDB | Blog
MongoDB | Blog
量子位
博客园_首页

Rat's Blog - Linux

使用Instantbox快速搭建一个开箱即用的Web端临时Linux系统 - Rat's Blog Windows VPS一键重装为Linux系统 - Rat's Blog Linux VPS一键安装桌面环境和RDP远程桌面连接 - Rat's Blog Linux VPS纯净版CentOS系统一键安装脚本 - Rat's Blog thefuck:Linux中一款可以自动纠正前一个命令行错误的工具 - Rat's Blog NodeQuery:一款好看的Linux VPS服务器信息监控工具 - Rat's Blog Linux VPS利用iptables string模块屏蔽指定的网站、文件等 - Rat's Blog DomainMegaBot:Linux上最好用的批量扫描域名的工具 - Rat's Blog Debian安装PHP 7.2教程 - Rat's Blog
Debian/Ubuntu使用update-rc.d命令添加/禁止开机启动项 - Rat...
博主: Rat's · 2018-04-04 · via Rat's Blog - Linux

说明:常用的Linux启动项就是在/etc/rc.localexit 0语句之间添加启动脚本,这里说下另一种方法,使用update-rc.d命令添加/禁止开机启动项,挺好用的。

使用

#将脚本添加开机自启,先放入/etc/init.d文件夹,并给予可执行权限
mv xx.sh /etc/init.d
chmod +x  /etc/init.d/xx.sh

#设置开机自启
update-rc.d xx.sh defaults

#删除开机自启
update-rc.d -f xx.sh remove

#如果你想禁止程序开机自启,比如apache2、nginx
update-rc.d -f apache2 remove
update-rc.d -f nginx remove

对于有时候不想卸载某些程序,又不想开机启动的,这种办法挺有用的,还可以节省CPU等资源的利用。


版权声明:本文为原创文章,版权归 Rat's Blog 所有,转载请注明出处!

本文链接:https://www.moerats.com/archives/577/

如教程需要更新,或者相关链接出现404,可以在文章下面评论留言。

Vultr新用户注册送100美元/16个机房按小时计费,支持支付宝,【点击查看】。