Enabling rc.local in debian9

rc.local is deprecated in debian 9 by default

To enable it

  1. create file /etc/systemd/system/multi-user.target.wants/rc.local.service

vi /etc/systemd/system/multi-user.target.wants/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

2. systemctl daemon-reload

3. systemcl restart rc.local.service