[systemd-devel] ExecStartPost in a systemd unit file does not start docker service

Mantas Mikulėnas grawity at gmail.com
Sun Apr 9 19:04:28 UTC 2017


Nested jobs are problematic as they usually result in a deadlock – you'll
have to use "/bin/systemctl --no-block restart docker" there.

Though the whole setup in general seems suspicious...

On Sat, Apr 8, 2017, 18:29 Alex Chistyakov <alexclear at gmail.com> wrote:

> Hello,
>
> I am trying to establish a connection between firewalld and docker
> services. I extended the default firewalld.service unit file by adding
> the following:
>
> [Service]
> ExecStartPost=-/bin/bash -c '/usr/bin/test -f /etc/default/docker &&
> /bin/systemctl stop docker && /bin/systemctl start docker'
>
> to /etc/systemd/system/firewalld.service.d/docker.conf.
>
> But this did not work, firewalld service timed out on start:
>
> root at ubuntu-xenial:~# systemctl status firewalld
> ● firewalld.service - firewalld - dynamic firewall daemon
>    Loaded: loaded (/lib/systemd/system/firewalld.service; enabled;
> vendor preset: enabled)
>   Drop-In: /etc/systemd/system/firewalld.service.d
>            └─docker.conf
>    Active: failed (Result: timeout) since Sat 2017-04-08 14:39:45 UTC;
> 1min 35s ago
>   Process: 26050 ExecStartPost=/bin/bash -c /usr/bin/test -f
> /etc/default/docker && /bin/systemctl stop docker && /bin/systemctl
> start docker (code=killed, signal=TERM)
>   Process: 26000 ExecStart=/usr/sbin/firewalld --nofork --nopid
> (code=exited, status=0/SUCCESS)
>  Main PID: 26000 (code=exited, status=0/SUCCESS)
>
> Apr 08 14:38:10 ubuntu-xenial systemd[1]: Starting firewalld - dynamic
> firewall daemon...
> Apr 08 14:39:41 ubuntu-xenial systemd[1]: firewalld.service:
> Start-post operation timed out. Stopping.
> Apr 08 14:39:45 ubuntu-xenial systemd[1]: Failed to start firewalld -
> dynamic firewall daemon.
> Apr 08 14:39:45 ubuntu-xenial systemd[1]: firewalld.service: Unit
> entered failed state.
> Apr 08 14:39:45 ubuntu-xenial systemd[1]: firewalld.service: Failed
> with result 'timeout'.
>
> I am aware of BindTo and Requires but I would like to restart the
> docker service on every state change of firewalld so these directives
> do not solve my problem.
>
> Thank you,
>
> --
> SY,
> Alex
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
-- 

Mantas Mikulėnas <grawity at gmail.com>
Sent from my phone
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20170409/58a4adcd/attachment.html>


More information about the systemd-devel mailing list