systemd drops lists concatenated with EOF

Bug #1696206 reported by Frederick Doe
6
This bug affects 1 person
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://github.com/GalliumOS/galliumos-distro/issues/369

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=/home/keeton/Permanent/Scripts/StayRunning.sh
```

`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.target`, will stop all three services as we would expect:
```
[Unit]
Description=This target will turn off Service's A, B, and C
Conflicts= \
ServiceA.service \
ServiceB.service \
ServiceC.service \

```

This target, `WillNotTurnOff.target`, will **not** stop the stop the services:
```
[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.target` contains a blank line between the last item on the list and the end of the file.

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?

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

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:
Conflicts=ServiceA.service ServiceB.service
Conflicts=ServiceC.service

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.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Is a unit with \ continuation lines present in Ubuntu packages?

Changed in systemd (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for systemd (Ubuntu) because there has been no activity for 60 days.]

Changed in systemd (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.