[pve-devel] [PATCH] cephserver : add systemd support V2

Alexandre DERUMIER aderumier at odiso.com
Tue May 17 16:53:32 CEST 2016


>>  ceph-mon: created monfs at /var/lib/ceph/mon/ceph-0 for mon.0
>>  Failed to start ceph-mon.target: Unit ceph-mon.target failed to load: No such file or directory.
>>  command '/bin/systemctl start ceph-mon.target' failed: exit code 6

Note that target are currently missing in package, but not service file
maybe can we improve the start of mon service after create, with specify the id.



----- Mail original -----
De: "Wolfgang Bumiller" <w.bumiller at proxmox.com>
À: "aderumier" <aderumier at odiso.com>
Cc: "pve-devel" <pve-devel at pve.proxmox.com>
Envoyé: Mardi 17 Mai 2016 16:37:54
Objet: Re: [pve-devel] [PATCH] cephserver : add systemd support V2

On Tue, May 17, 2016 at 09:44:42AM +0200, Alexandre Derumier wrote: 
> changelog : 
> - remove setsid 
> - use [A-Za-z0-9]{1,32} pattern for services 
> 
> Signed-off-by: Alexandre Derumier <aderumier at odiso.com> 
> --- 
> PVE/CephTools.pm | 20 +++++++++++++++++--- 
> 1 file changed, 17 insertions(+), 3 deletions(-) 
> 
> diff --git a/PVE/CephTools.pm b/PVE/CephTools.pm 
> index ec91f44..1eda1aa 100644 
> --- a/PVE/CephTools.pm 
> +++ b/PVE/CephTools.pm 
> @@ -191,9 +191,23 @@ sub setup_pve_symlinks { 
> } 
> 
> sub ceph_service_cmd { 
> - # ceph daemons does not call 'setsid', so we do that ourself 
> - # (fork_worker send KILL to whole process group) 
> - PVE::Tools::run_command(['setsid', 'service', 'ceph', '-c', $pve_ceph_cfgpath, @_]); 
> + my ($action, $service) = @_; 
> + 
> + if(-f "/lib/systemd/system/ceph-osd at .service") { 
> + 
> + if ($service && $service =~ m/^(mon|osd|mds|radosgw)(\.([A-Za-z0-9]{1,32}))?$/) { 
> + $service = $3 ? "ceph-$1\@$3" : "ceph-$1.target"; 
> + } else { 
> + $service = "ceph.target"; 
> + } 

I don't see any ceph .targets in the debian package. 
Now `pveceph createmon` fails with this: 
(...) 
ceph-mon: created monfs at /var/lib/ceph/mon/ceph-0 for mon.0 
Failed to start ceph-mon.target: Unit ceph-mon.target failed to load: No such file or directory. 
command '/bin/systemctl start ceph-mon.target' failed: exit code 6 

> + PVE::Tools::run_command(['/bin/systemctl', $action, $service]); 
> + 
> + } else { 
> + # ceph daemons does not call 'setsid', so we do that ourself 
> + # (fork_worker send KILL to whole process group) 
> + PVE::Tools::run_command(['setsid', 'service', 'ceph', '-c', $pve_ceph_cfgpath, $action, $service]); 
> + } 
> } 
> 
> sub list_disks { 
> -- 
> 2.1.4 
> 
> _______________________________________________ 
> pve-devel mailing list 
> pve-devel at pve.proxmox.com 
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel 
> 



More information about the pve-devel mailing list