Centos
# Rocky 9
systemctl cat rc-local
[Service] Type=forking ExecStart=/etc/rc.d/rc.local start
systemctl enable rc-local # 出 Error
systemctl edit rc-local
[Install] WantedBy=multi-user.target
Ubuntu
touch /etc/init.d/rc.local
chmod +x /etc/init.d/rc.local
update-rc.d rc.local start 20 2 3 4 5 . stop 20 0 1 6 .
ln -s /etc/init.d/rc.local /etc/rc.local