From 1bed46e4b0094863a119df59c6ae5f254c2e211d Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Thu, 7 Jan 2021 16:14:03 +0100 Subject: [PATCH] cephadm: silence "Failed to evict container" log msg Right now, we're printing some evil looking messages in the log: ``` systemd[1]: Starting Ceph mgr.node2.ankmgz for ... podman[32354]: Error: no container with name or ID ceph-... found: no such container bash[32363]: Error: Failed to evict container: "": Failed to find container "ceph-..." in state: no container with name or ID ceph-... found: no such container bash[32363]: Error: no container with ID or name "ceph-..." found: no such container ```` Also, the unit.run command already removes the container. No need for ExecStartPre to do the same. Signed-off-by: Sebastian Wagner --- src/cephadm/cephadm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index d822e137ae9..eaac93550dc 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -2208,10 +2208,10 @@ def _write_container_cmd_to_bash(file_obj, container, comment=None, background=F # unit file, makes it easier to read and grok. file_obj.write('# ' + comment + '\n') # Sometimes, adding `--rm` to a run_cmd doesn't work. Let's remove the container manually - file_obj.write('! '+ ' '.join(container.rm_cmd()) + '\n') + file_obj.write('! '+ ' '.join(container.rm_cmd()) + '2> /dev/null\n') # Sometimes, `podman rm` doesn't find the container. Then you'll have to add `--storage` if 'podman' in container_path: - file_obj.write('! '+ ' '.join(container.rm_cmd(storage=True)) + '\n') + file_obj.write('! '+ ' '.join(container.rm_cmd(storage=True)) + '2> /dev/null\n') # container run command file_obj.write(' '.join(container.run_cmd()) + (' &' if background else '') + '\n') @@ -2537,7 +2537,6 @@ Before=ceph-{fsid}.target LimitNOFILE=1048576 LimitNPROC=1048576 EnvironmentFile=-/etc/environment -ExecStartPre=-{container_path} rm ceph-{fsid}-%i ExecStart=/bin/bash {data_dir}/{fsid}/%i/unit.run ExecStop=-{container_path} stop ceph-{fsid}-%i ExecStopPost=-/bin/bash {data_dir}/{fsid}/%i/unit.poststop -- 2.39.5