mirror of
https://github.com/ceph/ceph
synced 2025-02-17 07:57:44 +00:00
class: make class tmp directory configurable, not /tmp
/tmp usually gets mounted with 'noexec', making it a poor choice. Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
parent
2096d8d77e
commit
cf38e86e81
1
debian/ceph.dirs
vendored
1
debian/ceph.dirs
vendored
@ -5,3 +5,4 @@ etc/ceph
|
||||
usr/share/doc/ceph
|
||||
var/log/ceph
|
||||
var/log/ceph/stat
|
||||
var/lib/ceph/tmp
|
1
debian/ceph.postinst
vendored
1
debian/ceph.postinst
vendored
@ -19,7 +19,6 @@ set -e
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
# ldconfig
|
||||
;;
|
||||
|
||||
abort-upgrade|abort-remove|abort-deconfigure)
|
||||
|
@ -22,21 +22,19 @@ void ClassHandler::_load_class(ClassData &cls)
|
||||
{
|
||||
dout(10) << "load_class " << cls.name << dendl;
|
||||
|
||||
char *fname=strdup("/tmp/class-XXXXXX");
|
||||
int fd = mkstemp(fname);
|
||||
cls_deps_t *(*cls_deps)();
|
||||
|
||||
for (list<bufferptr>::const_iterator it = cls.impl.binary.buffers().begin();
|
||||
it != cls.impl.binary.buffers().end(); it++)
|
||||
write(fd, it->c_str(), it->length());
|
||||
char fname[80];
|
||||
snprintf(fname, sizeof(fname), "%s/class-XXXXXX", g_conf.osd_class_tmp);
|
||||
|
||||
int fd = mkstemp(fname);
|
||||
cls.impl.binary.write_fd(fd);
|
||||
close(fd);
|
||||
|
||||
cls.handle = dlopen(fname, RTLD_NOW);
|
||||
|
||||
if (!cls.handle) {
|
||||
char buf[80];
|
||||
dout(0) << "could not open class (dlopen failed) " << strerror_r(errno, buf, sizeof(buf)) << dendl;
|
||||
dout(0) << "could not open class (dlopen failed): " << dlerror() << dendl;
|
||||
goto done;
|
||||
}
|
||||
cls_deps = (cls_deps_t *(*)())dlsym(cls.handle, "class_deps");
|
||||
@ -52,8 +50,6 @@ void ClassHandler::_load_class(ClassData &cls)
|
||||
cls.load();
|
||||
done:
|
||||
unlink(fname);
|
||||
free(fname);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -478,6 +478,7 @@ static struct config_option config_optionsp[] = {
|
||||
OPTION(osd_recovery_max_active, 0, OPT_INT, 5),
|
||||
OPTION(osd_auto_weight, 0, OPT_BOOL, false),
|
||||
OPTION(osd_class_timeout, 0, OPT_FLOAT, 10.0),
|
||||
OPTION(osd_class_tmp, 0, OPT_STR, "/var/lib/ceph/tmp"),
|
||||
OPTION(osd_check_for_log_corruption, 0, OPT_BOOL, false),
|
||||
OPTION(filestore, 0, OPT_BOOL, false),
|
||||
OPTION(filestore_max_sync_interval, 0, OPT_DOUBLE, 5), // seconds
|
||||
|
@ -344,6 +344,7 @@ struct md_config_t {
|
||||
bool osd_auto_weight;
|
||||
|
||||
bool osd_class_timeout;
|
||||
const char *osd_class_tmp;
|
||||
|
||||
bool osd_check_for_log_corruption; // bleh
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user