]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: ensure sysctl_dir exist
authorDimitri Savineau <dsavinea@redhat.com>
Mon, 12 Jul 2021 14:39:36 +0000 (10:39 -0400)
committerSebastian Wagner <sewagner@redhat.com>
Tue, 10 Aug 2021 14:31:22 +0000 (16:31 +0200)
For some reason, the sysctl directory could not exist if no packages dropping
a custom sysctl file is installed on the host.
Instead we create the directory if it doesn't exist.

Closes: https://tracker.ceph.com/issues/51620
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 71ba01f0180fa1ee7ff37e09adc20a5a0f4e896e)

src/cephadm/cephadm

index 1bd9773ac813f43c4ca0cdcb1812b7cdd78653b1..a997c1776dbe0a8a3208e7d159430a9bdddc5a16 100755 (executable)
@@ -2991,6 +2991,7 @@ def install_sysctl(ctx: CephadmContext, fsid: str, daemon_type: str) -> None:
 
     # apply the sysctl settings
     if lines:
+        Path(ctx.sysctl_dir).mkdir(mode=0o755, exist_ok=True)
         _write(conf, lines)
         call_throws(ctx, ['sysctl', '--system'])