method
#The following is a whole command, copied and run together 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
#The following is a whole command, copied and run together cat > /etc/rc.local <<EOF #!/ bin/sh # # 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 rc-local systemctl start rc-local.service
systemctl status rc-local.service
Copyright notice: This is an original article, and the copyright belongs to Rat's Blog All, please indicate the source for reprinting!
Link to this article: https://www.moerats.com/archives/623/
If the tutorial needs to be updated, or 404 appears on the related link, you can leave a comment below the article.