mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-06 03:15:21 +00:00
Add check if ceph is managed by systemd
Ceph is managed since version infernalis by systemd and use ceph as user and group.
This commit is contained in:
parent
93363a1128
commit
1aecf972bc
@ -193,7 +193,7 @@ sub setup_pve_symlinks {
|
||||
sub ceph_service_cmd {
|
||||
my ($action, $service) = @_;
|
||||
|
||||
if(-f "/lib/systemd/system/ceph-osd@.service") {
|
||||
if (systemd_managed()) {
|
||||
|
||||
if ($service && $service =~ m/^(mon|osd|mds|radosgw)(\.([A-Za-z0-9]{1,32}))?$/) {
|
||||
$service = defined($3) ? "ceph-$1\@$3" : "ceph-$1.target";
|
||||
@ -353,4 +353,15 @@ sub list_disks {
|
||||
return $disklist;
|
||||
}
|
||||
|
||||
# Ceph versions greater Hammer use 'ceph' as user and group instead
|
||||
# of 'root', and use systemd.
|
||||
sub systemd_managed {
|
||||
|
||||
if (-f "/lib/systemd/system/ceph-osd\@.service") {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
Loading…
Reference in New Issue
Block a user