Bug#1018872: systemd.service COMMAND LINE misses command search, if starting with "+".

Michael Biebl biebl at debian.org
Thu Sep 1 20:34:16 BST 2022


[please always CC the bug number]

You are all over the place now.
So, what is this bug report about actually?


Am 01.09.22 um 21:06 schrieb Harald Bergmann:
> Hello Michael,
> 
> after some testing things have cleared up much, but there is still a bug 
> in systemd, but only related to error message selection.
> First some facts by testing:
> 
>   * Now I agree that neither
>       o ExecStartPre=+mkdir -p /run/foo ; +chown michael /run/foo - nor
>       o distributing on multiple ExecStartPre commands have a problem on
>         command access.
>       o Assuming that there would have been a workaround like using
>         „/bin/mkdir“ was an illusion.
>   * Service start manually always operated - preparing the illusion,
>     that the workaround helped.
>   * Service autostart on boot always failed independent of workaround or
>     command distribution.
>   * Main error by me was a wrong [Install] statement:
>       o WantedBy=multi*.*user.target
>           + Correcting this to "WantedBy=multi*-*user.target“ results to
>             a well auto-starting service.
>   * Still existing error on systemd operation is the result of command:
>       o sudo systemd-analyze verify calendarserver.service
>           + calendarserver.service: Command mkdir is not executable:
>             Datei oder Verzeichnis nicht gefunden
>           + This happens always, even if manual- and auto-start operate
>             well, and even if folder does not exists and „mkdir“ really
>             need to act.
>           + Hence the error detection and message is simply wrong.
>       o Even worse is the fact, that this wrong message prevents telling
>         the real error position, probably by dropping further
>         examination after this first error-misinterpretation appears.
>       o Hence I like to ask you for looking after the error generation
>         method.
> 
> 
> Finally here is the now operating service configuration for being 
> complete regarding your demands:
> 
>     # Adaptation of some automatically generated configuration by
>     systemd-sysv-generator.
> 
>     [Unit]
>     Documentation=man:caldavd
>     Description=LSB: Calendar and Contacts Server
>     Before=multi-user.target
>     Before=graphical.target
>     After=network-online.target
>     After=remote-fs.target
>     Wants=network-online.target
>     Requires=postgresql.service
> 
>     [Service]
>     Type=forking
>     PIDFile=/run/caldavd/caldavd.pid
>     WorkingDirectory=/var/lib/caldavd
>     User=caldavd
>     Group=caldavd
>     Restart=always
>     TimeoutSec=10min
>     IgnoreSIGPIPE=no
>     SuccessExitStatus=5 6
>     ExecStartPre=+mkdir -p /run/caldavd ; +chown -R caldavd:caldavd
>     /run/caldavd
>     ExecStart=/usr/local/bin/caldavd -u caldavd -g caldavd
> 
> 
>     [Install]
>     WantedBy=multi-user.target
> 
> Many thanks for your patience and support!
> 
> Best regards,
> Harald
> 
>> Am 01.09.2022 um 12:27 schrieb Michael Biebl <biebl at debian.org 
>> <mailto:biebl at debian.org>>:
>>
>>
>> Am 01.09.22 um 12:08 schrieb Harald Bergmann:
>>> Hello Michael,
>>> thanks for your teaching!
>>> Please open a bug report for updating „man systemd.service“ 
>>> accordingly regarding section „COMMAND LINES“ starting from line 963.
>>> Many thanks for your support!
>>
>> I stand corrected. That said, I still can't reproduce the bug report:
>>
>> # cat test.service
>> [Unit]
>> Description=test
>>
>> [Service]
>> Type=oneshot
>> User=michael
>> ExecStartPre=echo foo ; echo bar
>> ExecStartPre=+mkdir -p /run/foo ; +chown michael /run/foo
>> ExecStart=/bin/true
>>
>>
>> # systemctl status test.service
>> ● test.service - test
>>     Loaded: loaded (/etc/systemd/system/test.service; static)
>>     Active: inactive (dead)
>>
>> Sep 01 10:56:05 raspberrypi-ka systemd[1]: Starting Test...
>> Sep 01 10:56:05 raspberrypi-ka echo[2432]: Hello World
>> Sep 01 10:56:05 raspberrypi-ka systemd[1]: test.service: Succeeded.
>> Sep 01 10:56:05 raspberrypi-ka systemd[1]: Finished Test.
>> Sep 01 12:25:12 raspberrypi-ka systemd[1]: Starting test...
>> Sep 01 12:25:12 raspberrypi-ka echo[3675]: foo
>> Sep 01 12:25:12 raspberrypi-ka echo[3676]: bar
>> Sep 01 12:25:13 raspberrypi-ka systemd[1]: test.service: Succeeded.
>> Sep 01 12:25:13 raspberrypi-ka systemd[1]: Finished test.
>>
>> # ls -ld /run/foo/
>> drwxr-xr-x 2 michael root 40  1. Sep 10:56 /run/foo/
>>
>> Maybe it would help if you posted a complete service file and complete 
>> error messages.
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20220901/fcbd7a71/attachment.sig>


More information about the Pkg-systemd-maintainers mailing list