diff --git a/pkg/operator/ceph/controller/spec.go b/pkg/operator/ceph/controller/spec.go index 8e58b752fd566..e8fd2778d5494 100644 --- a/pkg/operator/ceph/controller/spec.go +++ b/pkg/operator/ceph/controller/spec.go @@ -66,8 +66,6 @@ var logger = capnslog.NewPackageLogger("github.com/rook/rook", "ceph-spec") var ( cronLogRotate = ` -set -xe - CEPH_CLIENT_ID=%s PERIODICITY=%s LOG_ROTATE_CEPH_FILE=/etc/logrotate.d/ceph @@ -624,13 +622,18 @@ func LogCollectorContainer(daemonID, ns string, c cephv1.ClusterSpec) *v1.Contai Name: logCollector, Command: []string{ "/bin/bash", - "-c", + "-c", // Command to run + "-x", // Print commands and their arguments as they are executed + "-e", // Exit immediately if a command exits with a non-zero status. + "-m", // Terminal job control, allows job to be terminated by SIGTERM fmt.Sprintf(cronLogRotate, daemonID, c.LogCollector.Periodicity), }, Image: c.CephVersion.Image, VolumeMounts: DaemonVolumeMounts(config.NewDatalessDaemonDataPathMap(ns, c.DataDirHostPath), ""), SecurityContext: PodSecurityContext(), Resources: cephv1.GetLogCollectorResources(c.Resources), + // We need a TTY for the bash job control (enabled by -m) + TTY: true, } }