rc.local не работает в debian

rc.local systemd systemctl

rc.local не работает в debian

Когда пытаешься /etc/rc.local to run on system boot with the command:

sudo systemctl enable rc-local

Получаем ошибку:

The unit files have no [Install] section. They are not meant to be enabled
using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
.wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
D-Bus, udev, scripted systemctl call, ...).

Правим файл юнита:

sudo systemctl edit --full rc-local
[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

Далее следующее:

systemctl daemon-reload
printf '%s\n' '#!/bin/bash' 'exit 0' | sudo tee -a /etc/rc.local
sudo chmod +x /etc/rc.local