]> git.proxmox.com Git - pve-manager.git/commitdiff
postinst: move dir creation to helper
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Thu, 11 Apr 2024 12:45:44 +0000 (14:45 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Thu, 11 Apr 2024 12:56:16 +0000 (14:56 +0200)
and guard it to only run on ceph-using systems (the regular 'inited' check
doesn't work as a guard for this, because it checks for new-style inits
including the dir existing).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
bin/pve-init-ceph-crash
debian/postinst

index 89170b2e5cff4e34dccac2949e1ee8237826f6cd..4ec95a2de63f67cdec444380188f7c589ba0da94 100755 (executable)
@@ -66,6 +66,14 @@ sub main {
         exit 0;
     }
 
+    my $ceph_cfg_path = PVE::Ceph::Tools::get_config('pve_ceph_cfgpath');
+    if (PVE::Ceph::Tools::check_ceph_installed('ceph_mon', 1) && -f $ceph_cfg_path) {
+       my $pve_ceph_cfgdir = PVE::Ceph::Tools::get_config('pve_ceph_cfgdir');
+       if (! -d $pve_ceph_cfgdir) {
+           File::Path::make_path($pve_ceph_cfgdir);
+       }
+    }
+
     eval {
         PVE::Ceph::Tools::check_ceph_inited();
     };
index d3ca13be2101c7e1d54aec05ad51b63dd63bbfcc..c97c4fdbe20a79d196f235a70eab1557d20c733a 100755 (executable)
@@ -81,13 +81,8 @@ EOF
 }
 
 update_ceph_conf() {
-    CEPH_CONF_DIR='/etc/pve/ceph'
     UNIT='ceph-crash.service'
 
-    if test ! -d "${CEPH_CONF_DIR}"; then
-        mkdir -p "${CEPH_CONF_DIR}"
-    fi
-
     # Don't fail in case user has "exotic" configuration where RADOS
     # isn't available on all nodes for some reason
     /usr/share/pve-manager/helpers/pve-init-ceph-crash || true