I created a systemd service rc-local.service
as below and placed it in /etc/systemd/system
, enabled it, started it.
It is supposed to run the /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
(which is freshly created every time the /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
What can I change to make it all work?
/etc/rc.local
exists and is executable, systemd automatically creates and enables a unit for running it. Would the script running twice in parallel because of your extra unit cause problems?rc.local
to a minimal part which reproduces the behaviour (writes to log file every time, but doesn't run some other specific action at boot)systemd-rc-local-generator
is indeed present and installed by default. Please edit your question and use code blocks to add code.