[pve-devel] [PATCH V3 4/5] Mask the SysV scripts and enable our systemd service.
Wolfgang Link
w.link at proxmox.com
Tue Dec 20 12:23:42 CET 2016
This is important to control the exact start-up of ceph at boot.
We have the ceph.conf in the pmxcfs so pve-cluster.service must startup first.
The ceph.sevice is a link to the old SysV script.
For more information see http://tracker.ceph.com/issues/18305 .
---
PVE/CLI/pveceph.pm | 10 ++++++++++
1 file changed, 10 insertions(+)
changes V2
fix typo
changes V3
move mask ceph.service and enable pve-ceph-disk.service form createmon to install.
diff --git a/PVE/CLI/pveceph.pm b/PVE/CLI/pveceph.pm
index c6af98d..240372d 100755
--- a/PVE/CLI/pveceph.pm
+++ b/PVE/CLI/pveceph.pm
@@ -131,6 +131,16 @@ __PACKAGE__->register_method ({
'install', '--',
'ceph', 'ceph-common', 'gdisk');
+ if (PVE::CephTools::systemd_managed()) {
+ #to disable old SysV init scripts.
+ eval { PVE::Tools::run_command(['/bin/systemctl', 'mask', 'ceph.service']); };
+ warn "Can't mask ceph.service\n" if $@;
+
+ #to ensure we have the correct startup order.
+ eval { PVE::Tools::run_command(['/bin/systemctl', 'enable', 'pve-ceph-disk.service']); };
+ warn "Enable pve-ceph-disk.service manually\n"if $@;
+ }
+
return undef;
}});
--
2.1.4
More information about the pve-devel
mailing list