Project

General

Profile

Actions

Feature #2755

closed

ceph-conftool: optionally return the default for a config option if no value is set in ceph.conf.

Added by Florian Haas almost 12 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

Presently, the only way to figure out what the default for a specific configuration option is, is to consult the source at src/common/conig_opts.h.

ceph-conf, on the other hand, returns an empty value (and exits nonzero) for both a valid config option that isn't set, and an unsupported config option.

Suggest to change ceph-conf to:
- exit 1 on an unsupported config option at all times
- exit 0 and returning the default for a supported option with no value set (optionally toggled by a --defaults option)
- exit 0 and returning the configured value if configured.

Actions #1

Updated by Loïc Dachary over 9 years ago

  • Status changed from New to Resolved

Marking as resolved since there now is a way to get the default value, although not as suggested.

loic@fold:~/software/ceph/ceph/src$ ./ceph-conf --show-config-value kkk
failed to get config option 'kkk': option not found
loic@fold:~/software/ceph/ceph/src$ echo $?
1
loic@fold:~/software/ceph/ceph/src$ ./ceph-conf --show-config-value rgw_exit_timeout_secs
120
loic@fold:~/software/ceph/ceph/src$ echo $?
0
loic@fold:~/software/ceph/ceph/src$ ./ceph-conf --lookup k
loic@fold:~/software/ceph/ceph/src$ echo $?
1
loic@fold:~/software/ceph/ceph/src$ ./ceph-conf --lookup fsid
8d1dc3a1-10fa-4f9a-a3ad-3a4056e1f1a3
loic@fold:~/software/ceph/ceph/src$ grep fsid ceph.conf
        fsid = 8d1dc3a1-10fa-4f9a-a3ad-3a4056e1f1a3
loic@fold:~/software/ceph/ceph/src$ ./ceph-conf --lookup rgw_exit_timeout_secs
loic@fold:~/software/ceph/ceph/src$ echo $?
1
loic@fold:~/software/ceph/ceph/src$ grep rgw_exit_timeout_secs ceph.conf
loic@fold:~/software/ceph/ceph/src$ 

Actions

Also available in: Atom PDF