How to enable rc.local via systemd

1. Check rc-local status

sudo systemctl status rc-local

2. Make a rc-local service

sudo nano /etc/systemd/system/rc-local.service

[Unit]
Description=/etc/rc.local Compatibility
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

… save and quit

Ctrl o
Ctrl x

3. Make a /etc/rc.local file

printf '%s\n' '#!/bin/bash' 'exit 0' | sudo tee -a /etc/rc.local

sudo chmod +x /etc/rc.local

4. Enable and start rc-local

sudo systemctl enable rc-local

sudo systemctl start rc-local.service

sudo systemctl status rc-local.service