Debian添加回rc.loacl

Debian

1.创建rc.local文件

cat <<EOF >/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
EOF

2.添加权限

chmod 744 /etc/rc.local

3.启动

systemctl start rc-local

Centos8

将 rc.local 文件设置为可执行文件

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

启动

systemctl start rc-local

设置为开机启动

systemctl enable rc-local

# Debian 

本文由:星际难民
实践,测试,整理发布.如需转载请注明地址 本文标题:Debian添加回rc.loacl
地址:https://530503.xyz/articles/2021/08/23/1629718993550.html

评论

取消