2

I take a simple example: systemd-timesyncd.service
This service is responsible to keep time accurate (like the regular NTP server, but it only act as a lightweight client, and synchronize to only one server at a time).

The default configuration file /etc/systemd/timesyncd.conf is empty so the compile-time parameters are used.

If I download the source code, I can see what are the default parameters.
If I get my specific distribution (Debian) patches I can see the custom default parameters (if any).

For example the NTP servers used by default are time{1,2,3,4}.google.com
And Debian replace them by {0,1,2,3}.debian.pool.ntp.org at compile-time.

I can see which server is currently used: systemctl status systemd-timesyncd.service
This allow to have an idea about the default configuration. But this is far incomplete, even if it is probably often easy to guess the remaining servers.

Question: is there a standard way to display the default parameters for a systemd service?

1
  • 1
    What about systemctl cat systemd-timesyncd.service? Are you sure compile-time parameters are being used, and there are no options being set from other directories that systemd uses?
    – muru
    Nov 22, 2015 at 2:54

1 Answer 1

3

Question: is there a standard way to display the default parameters for a systemd service?

There is no standard way to display the default parameters for a systemd service.

Many services expose some parameters on the bus.

For example:

busctl call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.DBus.Properties GetAll "s" ""

shows properties of the manager itself.

Output contains RuntimeWatchdogSec, ShutdownWatchdogSec(as RuntimeWatchdogUSec and ShutdownWatchdogUSec), LogLevel, DefaultStandardOutput, DefaultStandardError etc.

I take a simple example: systemd-timesyncd.service

See: https://github.com/systemd/systemd/issues/1589

2
  • "call" available since v218. systemctl show shows properties of the manager itself too.
    – Evgeny
    Nov 22, 2015 at 13:09
  • you can use dbus-send: dbus-send --print-reply --system --type=method_call --dest=org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.DBus.Properties.GetAll string:'':)
    – Evgeny
    Nov 22, 2015 at 13:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .