Laut Ubuntu Wiki soll schon seit Version 14.04 die rc.local inaktiv sein => https://wiki.ubuntuusers.de/rc.local/
Abgeleitet aus dem Ubuntu Wiki
Service erstellen:
Code: Select all
sudo vim /etc/systemd/system/multi-user.target.wants/rc-local.service
Code: Select all
[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
Code: Select all
sudo ln -s /etc/systemd/system/multi-user.target.wants/rc-local.service /etc/systemd/system/rc-local.service
Code: Select all
sudo vim /etc/rc.local
Code: Select all
#!/bin/bash
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
exit 0
Datei als ausführbar markieren
Code: Select all
sudo chmod +x /etc/rc.local
Code: Select all
sudo systemctl enable rc-local
Code: Select all
sudo systemctl start rc-local.service
sudo systemctl status rc-local.service