systemd failing enable with "service is transient or generated". What's wrong with this configuration?
Solution 1:
I suspect the file you placed in /etc/init.d/
was supposed to go to /etc/systemd/system/
.
Move the systemd .service
file away from the location meant for System V style init scripts and to a systemd unit directory, refresh available units & confirm you then are using the intended unit file:
# mv /etc/init.d/lidarr.service ~/lidarr.service.bak
# cp lidarr.service /etc/systemd/system/
# systemctl daemon-reload
# systemctl cat lidarr.service
(output should mention (only) your unit path at /etc/systemd/system/lidarr.service)
# systemctl start lidarr.service
# journalctl -e -u lidarr.service
The output may still contain other problems you might have follow-up questions about, but at least now you should be using your unit file.
Key points for understanding the problem you ran into:
- systemd units are far more complex & abstracted than simple sysv-style init scripts. systemd ships an automation to generate (and cleanup when no longer needed) suitable units files dynamically for compatibility. However, for any given unit name you can only use either generators or manage the unit file directly.
- If you write the systemd unit yourself (typically strongly preferred over automatic generation) the systemd unit file goes to a path such as
/etc/systemd/system/
- not mixed with the executable init scripts in/etc/init.d/
traditionally used by sysv-style init.
The manual for systemctl tells us the following about the generated
status:
The unit file was generated dynamically via a generator tool. See systemd.generator(7). Generated unit files may not be enabled, they are enabled implicitly by their generator.
So your error message means that one of the methods through which systemd can automatically generate unit files for you is in use, preventing you from using the one you wrote yourself.