systemd drops lists concatenated with EOF
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Expired
|
Undecided
|
Unassigned |
Bug Description
Disclaimer: I originally posted this on Gallium OS's bug tracker but was told that Gallium pulls directly from upstream Ubuntu. The original bug report can be found here:
https:/
Release: Gallium OS
Package: systemd
When a systemd target file contains a "Conflicts" list at the end of the file and does not provide a blank line between the end of the list and the end of the file the list is silently dropped.
This is easier to demonstrate than it is to explain.
Take the following files:
`ServiceA.service`, `ServiceB.service`, and `ServiceC.service` are identical:
```
[Unit]
Description=This service just remains on
[Service]
Restart=always
ExecStart=
```
`StayRunning.sh` is:
```
#!/bin/sh
while true
do
sleep 3
done
```
The three services launch a script that keeps on running indefinitely.
This target, `WillTurnOff.
```
[Unit]
Description=This target will turn off Service's A, B, and C
Conflicts= \
ServiceA.service \
ServiceB.service \
ServiceC.service \
```
This target, `WillNotTurnOff
```
[Unit]
Description=This target will *not* turn off Service's A, B, and C
Conflicts= \
ServiceA.service \
ServiceB.service \
ServiceC.service \
```
Notice the difference. `WillTurnOff.
Several things to note:
* I'm pretty sure that this is a bug in systemd, but Gallium's on systemd version 229, which is more than two versions behind the latest version.
* I'm guessing that systemd is concatenating the EOF onto the list since the list ends with a backslash.
* Shouldn't systemd at least spit out a warning that something is wrong?
I have no idea what Gallium OS is. And indeed launchpad, Ubuntu project only tracks Ubuntu bugs and Official Flavours.
Gallium OS is not an official Ubuntu flavour.
You may want to report this upstream.
I do not think this is a bug at all, as new lines are not a valid syntax of systemd units, which is strict, and does not allow multi-line stanzas like that.
Valid syntax is: ServiceA. service ServiceB.service ServiceC. service
Conflicts=
Conflicts=
As in, space-separated single line value, and the Conflicts= can be repeated multiple times and the values will be concantenated.
If you have further questions please see errors in the journal, from systemd about processing/loading that unit, or seek support from systemd community mailing list.