Score:1

Show a systemd unit file with its overrides merged in

kr flag

systemctl cat myunit.service prints the contents of the main myunit.service file followed by any override files. Is there a way to print the unit file that systemd will actually use, i.e. the one formed from merging the overrides into the main unit?

Score:1
it flag

You can use systemctl show myunit.service to display properties of the unit. It will print all properties associated with that unit file, global configuration and any customizations made in unit file(s).

By default, empty properties are suppressed. Use --all to show those too.

systemctl show myunit.service --all

If you want to check a given property, use the following synthax:

systemctl show myunit.service --property=<PROPERTY_NAME> 

#example
#systemctl show myunit.service --property=ExecStart 

Note that the output may be not exactly what you expect:

Note that the properties shown by the command are generally more low-level, normalized versions of the original configuration settings and expose runtime state in addition to configuration. For example, properties shown for service units include the service's current main process identifier as "MainPID" (which is runtime state), and time settings are always exposed as properties ending in the "...USec" suffix even if a matching configuration options end in "...Sec", because microseconds is the normalized time unit used internally by the system and service manager.

For details about many of these properties, see the documentation of the D-Bus interface backing these properties, see org.freedesktop.systemd1(5).

kr flag
That worked - thanks a lot! Is there a way to hide settings that are their default values?
Chris avatar
it flag
@Sean Unfortunately I don't think so. I just discovered that command and man page doesn't show an option for that. The only thing I see is to set explicitly all properties you want to check `systemctl show myunit.service --property=PROPERTY1,PROPERTY2,PROPERTY3` .
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.