ibuildthecloud / systemd-docker

Wrapper for "docker run" to handle systemd quirks
Apache License 2.0
721 stars 111 forks source link

Is there a way to prevent systemd-docker from calling systemd-notify? #9

Closed apatil closed 10 years ago

apatil commented 10 years ago

My use case is wanting to call systemd-notify when health checks against a container pass. This happens after the container starts, so systemd-docker's current notify call is too early.

I could use --notify=true and modify the code inside the container to do the health checks, but prefer to do the health checks from outside so that the container code is agnostic to whether it runs on systemd & therefore more portable.

ibuildthecloud commented 10 years ago

By passing --notify=true that means that systemd-docker will not send READY=1 to the notify socket. Additionally it will bind mount in the socket into the container. Now the container doesn't actually have to send READY=1, you could have the container do nothing and then have something else outside the container send ready.

Would that work?

apatil commented 10 years ago

Yes, it does. I thought that the 'notify' function was blocking for some reason when I opened the issue. Thanks!