On the latest debian version the /etc/rc.local file is deprecated, but we can add it back using systemd for those scripts or applications that still depend on it. Note that this is not the correct way of doing it, and you should probably create a service for your script or application, but if you don’t want to spend the time just yet to migrate everything over you can simple add the rc.local file back into Debian 10.
cat <<EOF >> /etc/systemd/system/rc-local.service [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 Then we create the rc.local file again 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
chmod +x /etc/rc.local
systemctl enable rc-local
systemctl start rc-local
systemctl status rc-local
sumber: https://www.troublenow.org/752/debian-10-add-rc-local/
|
Blog >