systemd RequiresMountsFor multiline syntax

I know that this is a valid systemd unit configuration file syntax:

[Unit]
RequiresMountsFor=/mnt/foo /mnt/bar
...

Recently, I've seen a multiline variant of the above:

[Unit]
RequiresMountsFor=/mnt/foo
RequiresMountsFor=/mnt/bar
...

Are these two syntaxes semantically equivalent?

I checked the RequiresMountsFor option in the systemd.unit manpage, which explicitly states: "Takes a space-separated list of absolute paths." Also there's a hint on similarities with Requires and After options. The Requires option's documentation explicitly states that the single-line and multi-line syntaxes are equivalent (for the Requires option): "This option may be specified more than once or multiple space-separated units may be specified in one option in which case requirement dependencies for all listed names will be created." So I'd guess that the same applies to RequiresMountsFor.


Looks like it’s equivalent indeed:

# tee /run/systemd/system/serverfault-1085820.service >/dev/null << 'EOF'
[Unit]
RequiresMountsFor=/mnt/foo
RequiresMountsFor=/mnt/bar
[Service]
ExecStart=echo hi
EOF
# systemctl daemon-reload
# SYSTEMD_PAGER=cat systemctl show -p RequiresMountsFor serverfault-1085820.service 
RequiresMountsFor=/mnt/bar /mnt/foo

This should probably be documented better in the manpage; it’s not true for all directives, as systemd.syntax(7) points out:

Various settings are allowed to be specified more than once, in which case the interpretation depends on the setting. Often, multiple settings form a list, and setting to an empty value "resets", which means that previous assignments are ignored. When this is allowed, it is mentioned in the description of the setting.