<p>I have a sidecar container in a MySQL Pod which will use the MySQL socket file in order to access the database.</p>
<p>I would like to be sure MySQL has successfully started and therefore have created the socket file before than this sidecar container starts.</p>
<p>I tried to add a <code>readiness</code> probe with an <code>exec.command</code> being <code>test -S /var/run/mysqld/mysqld.sock</code> but it fails with:</p>
<pre><code>Readiness probe failed: OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: &quot;test -S /var/run/mysqld/mysqld.sock&quot;: stat test -S /var/run/mysqld/mysqld.sock: no such file or directory: unknown
</code></pre>
<p>When I open a terminal session in the sidecar container, I can <code>ls</code> the socket file and it's there.</p>
<p>So it looks like my <code>test -S &lt;path&gt;</code> command doesn't work as expected in the context of the probe.</p>
<p>How can I write my probe so that as soon as the socket file is available my sidecar container starts?</p>

ZedTuX
<p>Try:</p>
<pre><code>...
readinessProbe:
  exec:
    command:
    - sh
    - -c
    - test -S /var/run/mysqld/mysqld.sock
</code></pre>
