diff --git a/files/docker/systemctl.py b/files/docker/systemctl.py index 28e934c..0edce83 100755 --- a/files/docker/systemctl.py +++ b/files/docker/systemctl.py @@ -810,6 +810,8 @@ def read_sysd(self, filename): else: # hint: an empty line shall reset the value-list self.set(section, name, text and text or None) + if nextline: + self.set(section, name, text) return self def read_sysv(self, filename): """ an LSB header is scanned and converted to (almost) diff --git a/files/docker/systemctl3.py b/files/docker/systemctl3.py index c29ba2d..86ae586 100755 --- a/files/docker/systemctl3.py +++ b/files/docker/systemctl3.py @@ -810,6 +810,8 @@ def read_sysd(self, filename): else: # hint: an empty line shall reset the value-list self.set(section, name, text and text or None) + if nextline: + self.set(section, name, text) return self def read_sysv(self, filename): """ an LSB header is scanned and converted to (almost) diff --git a/testsuite.py b/testsuite.py index 9c3e99f..e4adc05 100755 --- a/testsuite.py +++ b/testsuite.py @@ -1383,17 +1383,27 @@ def test_1062_can_have_multi_line_settings_with_linebreak_mark(self) -> None: which is quite special [Service] PIDFile=/var/run/zzfoo.pid + ExecStart=sleep \\ + 2 \\ + """) textA = reads(os_path(root, "/etc/systemd/system/zza.service")) self.assertTrue(greps(textA, "Testing A")) self.assertTrue(greps(textA, "quite special")) self.assertTrue(greps(textA, "PIDFile=")) + self.assertTrue(greps(textA, "ExecStart=")) cmd = "{systemctl} __get_description zza.service" out, end = output2(cmd.format(**locals())) logg.info("%s => \n%s", cmd, out) self.assertEqual(end, 0) self.assertTrue(greps(out, "Testing A")) self.assertTrue(greps(out, "quite special")) + cmd = "{systemctl} command zza.service" + out, end = output2(cmd.format(**locals())) + logg.info("%s => \n%s", cmd, out) + self.assertEqual(end, 0) + self.assertEqual(len(lines(out)), 3) + self.assertTrue(greps(out, "sleep \\\\")) cmd = "{systemctl} __get_pid_file zza.service" out, end = output2(cmd.format(**locals())) logg.info("%s => \n%s", cmd, out)