I created a systemd service rc-local.servicerc-local.service
as below and placed it in /etc/systemd/system/etc/systemd/system
, enabled it, started it.
It is supposed to run the /etc/rc.local/etc/rc.local
script at boot time, which it does. I know this because to writes to the log file /var/log/rc-local.log/var/log/rc-local.log
(which is freshly created every time the /etc/rc.local/etc/rc.local
script is run) without error messages.
The only trouble is, the deamons that are supposed to be installed at boot time by rc.local are not installed. If I run rc.local as root after login everything runs as it should.
Here's the service file.
'''
[Unit]
Description=Run a boot-time shell script
After=network.target
StartLimitBurst=5
StartLimitIntervalSec=10
[Service]
Type=simple
Restart=on-failure
RestartSec=2
User=root
ExecStart=/etc/rc.local
[Install]
WantedBy=multi-user.target
'''
[Unit]
Description=Run a boot-time shell script
After=network.target
StartLimitBurst=5
StartLimitIntervalSec=10
[Service]
Type=simple
Restart=on-failure
RestartSec=2
User=root
ExecStart=/etc/rc.local
[Install]
WantedBy=multi-user.target
What can I change to make it all work?