1

When I execute systemctl list-unit-files does not show my service command it does not show my service (called example). What can be the reason of that?

init.d file location:

/etc/rc.d/init.d/example

service files:

/run/systemd/generator.late/example.service
/run/systemd/generator.late/runlevel5.target.wants/example.service
/run/systemd/generator.late/runlevel4.target.wants/example.service
/run/systemd/generator.late/runlevel3.target.wants/example.service
/run/systemd/generator.late/runlevel2.target.wants/example.service

.Service file:

# Automatically generated by systemd-sysv-generator

[Unit]
Documentation=man:systemd-sysv-generator(8)
SourcePath=/etc/rc.d/init.d/example
Description=SYSV: Application Suite
Before=runlevel2.target
Before=runlevel3.target
Before=runlevel4.target
Before=runlevel5.target
After=network-online.target
After=network.service

[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
ExecStart=/etc/rc.d/init.d/example start
0

Use systemctl list-unit instead, it will show all loaded (active) units, including those generated.

The list-unit-files only works for the actual installed unit files. To debug the generated ones looking at the /run directory is I guess fine. Alternatively you can use systemctl show example.service to see the in-memory properties, which has some overlap with the unit files.

BTW, for a given unit name, you can use systemctl is-enabled <name> -l to see if it is „generated“, or where it is statically installed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.