Skip to content

Commit b76dc13

Browse files
postinst: move dir creation to helper
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 <[email protected]>
1 parent 85c14e2 commit b76dc13

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

bin/pve-init-ceph-crash

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ sub main {
6666
exit 0;
6767
}
6868

69+
my $ceph_cfg_path = PVE::Ceph::Tools::get_config('pve_ceph_cfgpath');
70+
if (PVE::Ceph::Tools::check_ceph_installed('ceph_mon', 1) && -f $ceph_cfg_path) {
71+
my $pve_ceph_cfgdir = PVE::Ceph::Tools::get_config('pve_ceph_cfgdir');
72+
if (! -d $pve_ceph_cfgdir) {
73+
File::Path::make_path($pve_ceph_cfgdir);
74+
}
75+
}
76+
6977
eval {
7078
PVE::Ceph::Tools::check_ceph_inited();
7179
};

debian/postinst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,8 @@ EOF
8181
}
8282

8383
update_ceph_conf() {
84-
CEPH_CONF_DIR='/etc/pve/ceph'
8584
UNIT='ceph-crash.service'
8685

87-
if test ! -d "${CEPH_CONF_DIR}"; then
88-
mkdir -p "${CEPH_CONF_DIR}"
89-
fi
90-
9186
# Don't fail in case user has "exotic" configuration where RADOS
9287
# isn't available on all nodes for some reason
9388
/usr/share/pve-manager/helpers/pve-init-ceph-crash || true

0 commit comments

Comments
 (0)