习惯性把一些启动的东西扔rc.local里去,Debian9、10、11默认不带rc.local了,但是服务还在“/lib/systemd/system/rc-local.service”
默认情况下这个服务是关闭的,可以用systemctl status rc-local
查看
为了启用这个服务,我们需要手工添加一个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
chmod +x /etc/rc.local
systemctl enable --now rc-local
# 这里会有警告,无视就好