User Tools

Site Tools


debian:rc-local

This is an old revision of the document!


Enable /etc/rc.local in Debian

Create a file /etc/systemd/system/rc-local.service and place the following contents in it:

[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 the file and make it executable:

sudo chmod a+x /etc/systemd/system/rc-local.service

Create a file /etc/rc.local with this command:

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

Make it executable:

sudo chmod a+x /etc/rc.local

Finally, enable and start the newly created service with this command

sudo systemctl enable --now rc-local
debian/rc-local.1679862432.txt.gz · Last modified: (external edit)