<p>I have this script. A Pod will have two containers, one for the main application and the other for logging. I want the logging container to sleep to help me debug an issue.</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: codingjediweb
spec:
  replicas: 2
  selector:
    matchLabels:
      app: codingjediweb
  template:
    metadata:
      labels:
        app: codingjediweb
    spec:
      volumes:
      - name: shared-logs
        emptyDir: {}
      containers:
      - name: codingjediweb
        image: docker.io/manuchadha25/codingjediweb:03072020v2
        volumeMounts:
        - name: shared-logs
          mountPath: /deploy/codingjediweb-1.0/logs/
        env:
        - name: db.cassandraUri
          value: cassandra://xx.yy.xxx.yyy:9042
        - name: db.password
          value: 9__
        - name: db.keyspaceName
          value: somei
        - name: db.username
          value: supserawesome
        ports:
        - containerPort: 9000
      - name: logging
        image: busybox
        volumeMounts:
        - name: shared-logs
          mountPath: /deploy/codingjediweb-1.0/logs/
        command: [&quot;tail -f /deploy/codingjediweb-1.0/logs/*.log&quot;]
</code></pre>
<p>Before running <code>tail -f ...</code>,  I want to add a <code>sleep</code>/delay to avoid a race condition (the application takes sometime before logging and tail -f fails in the meanwhile because the log file doesn't exist. Alternatively, I am ok to run a script like this - <code>while true; do sleep 86400; done </code>.</p>
<p>How can I do that?</p>

Manu Chadha
<p>got it - had to do <code>command: ['sh', '-c', &quot;while true; do sleep 86400; done&quot;]</code></p>
