]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: do not force container removal on unit stop
authorSage Weil <sage@redhat.com>
Mon, 16 Dec 2019 21:55:51 +0000 (15:55 -0600)
committerSage Weil <sage@redhat.com>
Tue, 17 Dec 2019 13:02:38 +0000 (07:02 -0600)
The -f arg for 'podman rm' will remove the container without actually
stopping it, leaving the running containers and processes (conmon and
daemon) running and generally making a mess of things.

Doing 'podman rm' without the -f on a running container will complain
that the container is still running.

So, first stop, then remove.

Fixes: f1de7060762d31e567a277c02b0d8d533fbb4661
Signed-off-by: Sage Weil <sage@redhat.com>
src/cephadm/cephadm

index 9fea0b3add05e476a34f1b00823d903059a7d65d..0f727af1bbeec5ecb5e4e5f3021baf3c1383e9be 100755 (executable)
@@ -1042,7 +1042,8 @@ EnvironmentFile=-/etc/environment
 ExecStartPre=-{container_path} rm ceph-{fsid}-%i
 ExecStartPre=-{install_path} -d -m0770 -o {uid} -g {gid} /var/run/ceph/{fsid}
 ExecStart=/bin/bash {data_dir}/{fsid}/%i/unit.run
-ExecStop=-{container_path} rm -f ceph-{fsid}-%i
+ExecStop=-{container_path} stop ceph-{fsid}-%i
+ExecStop=-{container_path} rm ceph-{fsid}-%i
 ExecStopPost=-/bin/bash {data_dir}/{fsid}/%i/unit.poststop
 Restart=on-failure
 RestartSec=10s