X-osadminの自留地
  • 博客主页 HomePage
  • 技术小絮 Tech
  • 作品发布 Works
  • 软件专题 Softs
    • proxmox
    • openwrt
    • chromebook
    • Zerotier
    • 虚拟化
  • 友情链接 Following

xosadmin

BGPlayer / Codes learner / Love Linux
Posts
77
Comments
0

友情链接 – Friendly Links

  • Add your site here…
xosadmin
4 years ago

Debian 11启用rc.local方法

rc.local是一个令大家耳熟详的文件,它在Redhat系列操作系统中可以让用户添加自定义开机脚本并运行。但是在Debian 11操作系统中,这个功能不被默认开启。这篇文章将介绍如何开启rc.local。话不多说,开始~

  1. 先通过以下命令对systemd注入rc-local服务:

cat>>/etc/systemd/system/rc-local.service<<EOF
[Unit]
Description=/etc/rc.local
ConditionPathExists=/etc/rc.local

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99

[Install]
WantedBy=multi-user.target
EOF

2. 执行daemon reload和启动服务开机启动

systemctl daemon-reload && systemctl enable rc-local

3. 创建一个空白的rc.local文件,并写入头尾,如下方

touch /etc/rc.local

cat /etc/rc.local

#!/bin/sh -e

<your command>

exit 0

4. 对rc.local赋予权限以执行

chmod a+x /etc/rc.local

到这里,就全部完成了,在下一次重启中,该文件将会被自动调用并执行。

Enjoy~

  • 技术小絮
等 人表示很赞
2,936
0

📮Comments

No Comment.
xosadmin
xosadmin
6 years ago
推荐 借助树莓派将IP2780变网络打印机
近日,因为一些方面的需求,X-osadmin购入了iP2780喷墨打印机。但是iP2780的设计使其无法使用网络功能。换句话说,无法通过网络发现该台打印机,也无法通过网络发送打印指令使其开始打印,仅能使用USB连接计算机进行打印操作。但是 ...
  • 技术小絮
1,810 0
xosadmin
xosadmin
5 years ago
推荐 Proxmox VE提示No IOMMU detect的解决方法
Proxmox VE是一个非常强大的虚拟化平台。有许多用户正在通过Proxmox VE来实现软路由等功能。其中,最重要的一件事情就是pcie穿透(也是硬件直通)。但是通过最近的测试,在部分的机器上,会提示No IOMMU detected, ...
  • proxmox
  • 技术小絮
17,740 0
xosadmin
xosadmin
5 years ago
推荐 Proxmox挂载Windows Samba时报错的解决方法
近日在Proxmox的Web界面上挂载由Windows Server 2008共享的CIFS(Samba共享)时,界面报出以下错误: create storage failed: error with cfs lock ‘fil ...
  • proxmox
  • 技术小絮
5,908 0
xosadmin
xosadmin
5 years ago
推荐 Debian提示Malformed Description-md5的解决方法
近日,有一台vps在执行apt update时,报出以下错误,并返回错误值100。错误代码如下: E: Malformed Description-md5 line; doesn’t have the required leng ...
  • 技术小絮
1,661 0
xosadmin
xosadmin
2 years ago
推荐 Fail2ban无法启动的解决方法
在启动fail2ban时,有时会发生错误,具体错误如下: ERROR Failed during configuration: Have not found any log file for sshd jail ERROR Async co ...
  • 技术小絮
441 0
  • HPE Microserver系列降低噪音的一种办法
  • Debian 13 Trixie安装Proxmox VE
  • Windows FTP服务器通过PASV模式无法获取目录的解决方法
  • Proxmox日志出现大量lxcfs truncated错误的解决方案
  • Proxmox通过CLI向LXC挂载已有虚拟磁盘的方法
  • LXC上安装Gitlab时sysctl报错的解决方法

文章聚合

  • Debian 13 Trixie安装Proxmox VE
  • Proxmox日志出现大量lxcfs truncated错误的解决方案
  • Proxmox通过CLI向LXC挂载已有虚拟磁盘的方法
  • Proxmox VE通过全盘方式直通硬盘
  • Proxmox为KVM VNC启用剪贴板支持
  • Proxmox报出RRDC/RRD update error的解决方法

Multilangual Translator

Copyright © 2016-2025 X-osadminの自留地. All rights reserved. 萌ICP备20258855号
  • 博客主页 HomePage
  • 技术小絮 Tech
  • 作品发布 Works
  • 软件专题 Softs
    • proxmox
    • openwrt
    • chromebook
    • Zerotier
    • 虚拟化
  • 友情链接 Following
Welcome
Forgot password?
Welcome
Forgot password?
Social Login
Login with WeChat QR Code
Unregistered WeChat IDs will be automatically used to create an account.
Scan and Reply with Keywords「登录」Get Verification Code
Social Login
Free registration
Social Login
Reset password
Back to Login