[pve-devel] [PatchV2 pve-manager 1/3] Add check if ceph is managed by systemd.

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed May 25 12:27:24 CEST 2016


> Dietmar Maurer <dietmar at proxmox.com> hat am 25. Mai 2016 um 11:09 geschrieben:
> 
> 
> > +sub systemd_managed {
> > +
> > +    my $version;
> > +    my $outfunc = sub {
> > +	my $line = shift;
> > +
> > +	if ($line =~ m/ceph version (\d+).\d+.\d+/) {
> > +	    $version = $1;
> > +	}
> > +    };
> > +
> > +    run_command(['/usr/bin/ceph', '--version'], outfunc => $outfunc);
> 
> Isn't there an simpler test for that? I do not want 
> to run external command for such test.
> 

I think at least the naming here is very confusing - a method that checks that the version is bigger than 1 is called systemd_managed and the result is used to decide whether ceph services run as user ceph? I know that those two changes (providing systemd service files and running as user ceph) were made in the same release (together with a new versioning scheme), but conflating this (especially without comments) makes this very hard to read/follow..




More information about the pve-devel mailing list