What does the hyphen in the systemd unit file mean?

Asked 2 years ago, Updated 2 years ago, 87 views

Create and modify unit files for systemd - Red Hat Customer Portal

The "Example 9.17 postfix.service Unit File" on the page above contains:

EnvironmentFile=-/etc/sysconfig/network
ExecStartPre= - /usr/libexec/postfix/aliasesdb
ExecStartPre= -/usr/libexec/postfix/chroot-update

I don't know what the leading hyphen means.
Is it the systemd unit file format?
Or is the content of the Linux command grammatically meaningful?

linux systemd rhel

2022-09-30 15:30

1 Answers

(From comments)

According to Understanding Systemd Units and Unit Files, for ExecStartPre, they can be preceded by "-" to indicate that the failure of the command will be filtered.

EnvironmentFile is listed in systemd.exec(5) as optionally prefixed with "-", which indicates that if the file does not exist, it will not be read and no error or warning message is logged..


2022-09-30 15:30

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.