Re: Systemd ... Pass CL Params to Pgm ?

Liste des GroupesRevenir à ol misc 
Sujet : Re: Systemd ... Pass CL Params to Pgm ?
De : robin_listas (at) *nospam* es.invalid (Carlos E.R.)
Groupes : comp.os.linux.misc
Date : 12. Jun 2025, 11:27:47
Autres entêtes
Message-ID : <3mmqhlxcct.ln2@Telcontar.valinor>
References : 1 2 3
User-Agent : Mozilla Thunderbird
On 2025-06-12 11:58, The Natural Philosopher wrote:
On 12/06/2025 09:07, Carlos E.R. wrote:
 
EnvironmentFile=-/etc/sysconfig/spamd
 You have a directory called /-etc ???
 
No. The dash has a meaning in systemd parlance. I confess to not knowing what, so I asked chatgpt after looking perfunctorily at "https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html". This is the answer:
In a **systemd** service file, the line:
```
EnvironmentFile=-/etc/sysconfig/spamd
```
includes a **dash (`-`)** before the path. This dash is **significant**—it tells `systemd` to **ignore** the file **if it does not exist**.
### Meaning of the dash:
* `EnvironmentFile=/etc/sysconfig/spamd` → systemd **fails** to start the service if the file is missing.
* `EnvironmentFile=-/etc/sysconfig/spamd` → systemd **ignores the missing file** and continues starting the service without error.
### Use case:
This is helpful when the environment file is **optional** or only present in certain configurations or environments.
### Summary:
The dash (`-`) before the path means:
 > *"Use this environment file if it exists; otherwise, proceed without it."*
Let me know if you want a breakdown of how `EnvironmentFile` works with variables.
--
Cheers, Carlos.

Date Sujet#  Auteur
12 Jun 25 * Systemd ... Pass CL Params to Pgm ?31c186282
12 Jun 25 +* Re: Systemd ... Pass CL Params to Pgm ?8Richard Kettlewell
12 Jun 25 i`* Re: Systemd ... Pass CL Params to Pgm ?7Lawrence D'Oliveiro
12 Jun 25 i `* Re: Systemd ... Pass CL Params to Pgm ?6c186282
12 Jun 25 i  `* Re: Systemd ... Pass CL Params to Pgm ?5Carlos E.R.
12 Jun 25 i   `* Re: Systemd ... Pass CL Params to Pgm ?4Lawrence D'Oliveiro
12 Jun 25 i    `* Re: Systemd ... Pass CL Params to Pgm ?3Carlos E.R.
13 Jun 25 i     +- Re: Systemd ... Pass CL Params to Pgm ?1Lawrence D'Oliveiro
13 Jun 25 i     `- Re: Systemd ... Pass CL Params to Pgm ?1c186282
12 Jun 25 `* Re: Systemd ... Pass CL Params to Pgm ?22Carlos E.R.
12 Jun 25  `* Re: Systemd ... Pass CL Params to Pgm ?21The Natural Philosopher
12 Jun 25   `* Re: Systemd ... Pass CL Params to Pgm ?20Carlos E.R.
12 Jun 25    `* Re: Systemd ... Pass CL Params to Pgm ?19Lawrence D'Oliveiro
12 Jun 25     +* Re: Systemd ... Pass CL Params to Pgm ?13Carlos E.R.
13 Jun 25     i+* Re: Systemd ... Pass CL Params to Pgm ?4Lawrence D'Oliveiro
13 Jun 25     ii+- Re: Systemd ... Pass CL Params to Pgm ?1c186282
13 Jun 25     ii`* Re: Systemd ... Pass CL Params to Pgm ?2candycanearter07
14 Jun 25     ii `- Re: Systemd ... Pass CL Params to Pgm ?1rbowman
13 Jun 25     i`* Re: Systemd ... Pass CL Params to Pgm ?8Richard Kettlewell
13 Jun 25     i `* Re: Systemd ... Pass CL Params to Pgm ?7Carlos E.R.
14 Jun 25     i  `* Re: Systemd ... Pass CL Params to Pgm ?6Lawrence D'Oliveiro
14 Jun 25     i   +- Re: Systemd ... Pass CL Params to Pgm ?1c186282
14 Jun 25     i   `* Re: Systemd ... Pass CL Params to Pgm ?4Carlos E.R.
15 Jun 25     i    `* Re: Systemd ... Pass CL Params to Pgm ?3Lawrence D'Oliveiro
16 Jun 25     i     `* Re: Systemd ... Pass CL Params to Pgm ?2Carlos E.R.
17 Jun 25     i      `- Re: Systemd ... Pass CL Params to Pgm ?1c186282
13 Jun 25     `* Re: Systemd ... Pass CL Params to Pgm ?5Marc Haber
13 Jun 25      `* Re: Systemd ... Pass CL Params to Pgm ?4Lawrence D'Oliveiro
13 Jun 25       `* Re: Systemd ... Pass CL Params to Pgm ?3Marc Haber
13 Jun 25        `* Re: Systemd ... Pass CL Params to Pgm ?2Lawrence D'Oliveiro
13 Jun 25         `- Re: Systemd ... Pass CL Params to Pgm ?1Marc Haber

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal