Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
ded49bf4
Commit
ded49bf4
authored
Nov 20, 2013
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid useles symlinks to ceph keyrings
parent
84ab7b8b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
22 deletions
+7
-22
Ceph.pm
PVE/API2/Ceph.pm
+7
-22
No files found.
PVE/API2/Ceph.pm
View file @
ded49bf4
...
...
@@ -29,9 +29,7 @@ my $ceph_cfgdir = "/etc/ceph";
my
$pve_ceph_cfgpath
=
"
/etc/pve/
$ccname
.conf
";
my
$ceph_cfgpath
=
"
$ceph_cfgdir
/
$ccname
.conf
";
my
$pve_mon_key_path
=
"
/etc/pve/priv/
$ccname
.mon.keyring
";
my
$ceph_mon_key_path
=
"
$ceph_cfgdir
/
$ccname
.mon.keyring
";
my
$pve_ckeyring_path
=
"
/etc/pve/priv/
$ccname
.keyring
";
my
$ceph_ckeyring_path
=
"
$ceph_cfgdir
/
$ccname
.client.admin.keyring
";
my
$pve_ckeyring_path
=
"
/etc/pve/priv/
$ccname
.client.admin.keyring
";
my
$ceph_bootstrap_osd_keyring
=
"
/var/lib/ceph/bootstrap-osd/
$ccname
.keyring
";
my
$ceph_bootstrap_mds_keyring
=
"
/var/lib/ceph/bootstrap-mds/
$ccname
.keyring
";
...
...
@@ -42,8 +40,6 @@ sub purge_all_ceph_files {
# fixme: this is very dangerous - should we really support this function?
unlink
$ceph_cfgpath
;
unlink
$ceph_mon_key_path
;
unlink
$ceph_ckeyring_path
;
unlink
$pve_ceph_cfgpath
;
unlink
$pve_ckeyring_path
;
...
...
@@ -95,16 +91,6 @@ my $check_ceph_enabled = sub {
return
1
;
};
my
$force_symlink
=
sub
{
my
(
$old
,
$new
)
=
@_
;
return
if
(
-
l
$new
)
&&
(
readlink
(
$new
)
eq
$old
);
unlink
$new
;
symlink
(
$old
,
$new
)
||
die
"
unable to create symlink '
$new
' - $!
\n
";
};
my
$parse_ceph_config
=
sub
{
my
(
$filename
)
=
@_
;
...
...
@@ -150,7 +136,7 @@ my $run_ceph_cmd = sub {
# Note: --connect-timeout does not work with current version
# '--connect-timeout', $timeout,
run_command
(['
ceph
',
'
-c
',
$ceph_cfgpath
,
@$cmd
],
%
params
);
run_command
(['
ceph
',
'
-c
',
$
pve_
ceph_cfgpath
,
@$cmd
],
%
params
);
alarm
(
0
);
};
my
$err
=
$@
;
...
...
@@ -236,16 +222,14 @@ my $setup_pve_symlinks = sub {
my
$lnk
=
readlink
(
$ceph_cfgpath
);
die
"
file '
$ceph_cfgpath
' already exists
\n
"
if
!
$lnk
||
$lnk
ne
$pve_ceph_cfgpath
;
}
else
{
symlink
(
$pve_ceph_cfgpath
,
$ceph_cfgpath
)
||
die
"
unable to create symlink '
$ceph_cfgpath
' - $!
\n
";
}
# now assume we are allowed to setup/overwrite content
&
$force_symlink
(
$pve_ceph_cfgpath
,
$ceph_cfgpath
);
&
$force_symlink
(
$pve_mon_key_path
,
$ceph_mon_key_path
);
&
$force_symlink
(
$pve_ckeyring_path
,
$ceph_ckeyring_path
);
};
my
$ceph_service_cmd
=
sub
{
run_command
(['
service
',
'
ceph
',
'
-c
',
$ceph_cfgpath
,
@_
]);
run_command
(['
service
',
'
ceph
',
'
-c
',
$
pve_
ceph_cfgpath
,
@_
]);
};
...
...
@@ -565,6 +549,7 @@ __PACKAGE__->register_method ({
'
auth cluster required
'
=>
'
cephx
',
'
auth service required
'
=>
'
cephx
',
'
auth client required
'
=>
'
cephx
',
'
keyring
'
=>
'
/etc/pve/priv/$cluster.$name.keyring
',
'
filestore xattr use omap
'
=>
'
true
',
'
osd journal size
'
=>
'
1024
',
'
osd pool default size
'
=>
$size
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment