mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-06 17:10:35 +00:00
add get_local_services for ceph
this returns a hash of existing service links for mds/mgr/mons so that we know which services exists this is necessary since ceph itself does not save if a service is defined somewhere, only when it runs Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
180a86d39a
commit
23b20ae451
@ -9,6 +9,24 @@ use PVE::RADOS;
|
||||
|
||||
use File::Path;
|
||||
|
||||
# checks links in /etc/systemd/system/ceph-* to list all services, even
|
||||
# those not running
|
||||
sub get_local_services {
|
||||
my $res = {};
|
||||
for my $type (qw(mds mgr mon)) {
|
||||
$res->{$type} = {};
|
||||
my $path = "/etc/systemd/system/ceph-$type.target.wants";
|
||||
my $regex = "ceph-$type\@(.*)\.service";
|
||||
PVE::Tools::dir_glob_foreach($path, $regex, sub {
|
||||
my (undef, $id) = @_;
|
||||
$res->{$type}->{$id} = {
|
||||
service => 1,
|
||||
}
|
||||
});
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
sub ceph_service_cmd {
|
||||
my ($action, $service) = @_;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user