From: Sebastian Wagner Date: Thu, 7 Jan 2021 15:14:03 +0000 (+0100) Subject: cephadm: silence "Failed to evict container" log msg X-Git-Tag: v15.2.9~34^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8de531ed61bf89847303bc7482a409739f837351;p=ceph.git 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 (cherry picked from commit 1bed46e4b0094863a119df59c6ae5f254c2e211d) --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 326f236e834..d2cf05da82f 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -2192,10 +2192,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') @@ -2501,7 +2501,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