Включить rc.local в автозагрузку не примере Debian 9
1. Создать файл /etc/systemd/system/rc-local.service
sudo systemctl edit --full rc-local
Содержимое файла /etc/systemd/system/rc-local.service
[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local
Documentation=man:systemd-rc-local-generator(8)
ConditionFileIsExecutable=/etc/rc.local
After=network.target
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no
StandardOutput=tty
SysVStartPriority=99
[Install]
WantedBy=multi-user.target
2. Создать файл /etc/rc.local
#!/bin/sh -e
/usr/local/bin/my-custom-programm
exit 0
3. Подготовить сценарий к автозапуску
chmod +x /etc/rc.local
systemctl enable rc.local
systemctl start rc-local.service