Debian 启用 /etc/rc.local 添加开机自启动服务
Debian 中在 /etc/rc.local
添加命令即可实现开机自动执行命令/开机自启动。
Debian 9 自带有 rc-local
服务,但是没有启动,也没有 /etc/rc.local
文件。
首先看看 rc-local
服务有没有启动 systemctl status rc-local
显示Active: inactive (dead)
就是没有启动。
那么首先添加 /etc/rc.local
文件。
新建vim /etc/rc.local
文件,写入以下内容:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
exit 0
给予权限:
chmod +x /etc/rc.local
启动 rc-local 服务:
systemctl start rc-local
然后就可以编辑 /etc/rc.local
文件,把需要开机自动执行的命令写在 exit 0
前面。
(资源库 www.zyku.net)
上一篇:Debian安装Docker教程
栏 目:Debian
下一篇:debain 系统 ll 命令无法使用以及目录和文件没有颜色区分解决方法
本文标题:Debian 启用 /etc/rc.local 添加开机自启动服务
本文地址:https://www.zyku.net/debian/11111.html
您可能感兴趣的文章
- 03-31CentOS 7 开机/etc/rc.local 不执行的问题
- 03-31CentOS7添加开机启动服务或脚本
- 03-31Ubuntu 20 使用systemd创建自定义开机启动服务
- 03-31明道云私有化部署开机自启设置教程
- 03-14荣耀50禁止应用开机自启方法
- 03-15frp设置开机自启的方法
- 02-19详解Centos7下配置Redis并开机自启动
- 02-28wamp一键安装包开机自动启动的方法
- 02-22DedeCMS列表页调用文章内容第一张原图
- 09-13帝国CMS7.5编辑器换行将br标签替换为p
- 02-06小米11使用快捷键截屏方法汇总
- 12-31冲吖家长-冲吖家长应用软件功能介绍
- 12-23HTML <em> 标签
- 01-11oppo手机查看应用使用时间方法
- 02-18黑鲨4pro启用护眼模式教程
- 11-24小米10s怎么关闭震动效果
- 01-12智汇网TWMS-智汇网TWMS应用软件功能介
- 04-24清空MySQL表,使ID归零重新从1自增长
- 03-04oppoencoair设置游戏模式教程
- 01-19老鹰抓娃娃-老鹰抓娃娃应用软件功能介
最近更新
阅读排行
猜你喜欢
- 04-22华为nova8黑名单查找方法
- 01-10骆亩农务助手-骆亩农务助手应用软件功
- 01-12艺考志愿星-艺考志愿星应用软件功能介
- 02-18thinkphp常见路径用法分析
- 09-19小天才电话手表如何开启视频通话
- 02-25真我V13开启全面屏手势操作方法
- 09-22ios15怎么关闭专注模式
- 03-14帝国CMS请查看目录权限是否为0777,文件
- 03-14PHP如何关闭notice级别的错误提示
- 09-20红米note10pro怎么开启息屏显示