For When You Can't Have The Real Thing
[ start | index | login ]
start > Fedora > 35 > systemd


Created by dave. Last edited by dave, one year and 312 days ago. Viewed 481 times. #3
[diff] [history] [edit] [rdf]

God Dammit

List services as calculated as being required for run statesystemctl list-units
systemctl list-units --all
systemctl list-units --all --state=inactive
Start service at boot timesystemctl enable service
List all servicessystemctl list-unit-files
Start service nowservice service start
systemctl start service
Show unit filesystemctl cat service.service
Show dependenciessystemctl list-dependencies service.service
Show unit propertiessystemctl show service.service
systemctl show service.service -p Confilcts
Masking (make service completely un-runnable)systemctl mask service.service
systemctl unmask service.service
Editing"snippet": systemctl edit service.service
Full unit file: systemctl edit --full service.service


Description=Setup Ramdisk For Nagios

[Service] Type=oneshot ExecStart=/usr/local/sbin/setup-nagios-ramdisk RemainAfterExit=true ExecStop=/bin/true StandardOutput=journal


Indicate Dependency On Another Service

Description=Nagios Core 4.4.6
Documentation= setup-nagios-ramdisk.service


Note that in this case, indicating a dependency on a one-shot that doesn't leave anthing behind, systemd won't run the dependency before running what you've asked for.

ie, if nagios-setup-ramdisk.service has not been executed since boot, starting nagios.service will result in an error (because the local nagios configuration can't find the pieces that the setup one-shot creates for it).

Oldie-style sysv-init files

Read about how systemd deals with non-systemd-native stuff: >>here

no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful: | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt