On Thu, Jan 28, 2016 at 12:17:58PM +0530, Raghavendra Talur wrote: > Where do I find config in NetBSD which decides which location to dump core > in? I crafted the patch below, bbut it is probably much simplier to just set kern.defcorename to /%n-%p.core on all VM slaves. I will do it. diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 272d08f..2fd2d7d 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -29,6 +29,10 @@ #include <fcntl.h> #endif /* HAVE_LINKAT */ +#ifdef __NetBSD__ +#include <sys/sysctl.h> +#endif /* __NetBSD__ */ + #include "glusterfs.h" #include "checksum.h" #include "dict.h" @@ -6631,6 +6635,8 @@ init (xlator_t *this) _private->path_max = pathconf(_private->base_path, _PC_PATH_MAX); if (_private->path_max != -1 && _XOPEN_PATH_MAX + _private->base_path_length > _private->path_max) { + char corename[] = "/%n-%p.core"; + ret = chdir(_private->base_path); if (ret) { gf_msg (this->name, GF_LOG_ERROR, 0, @@ -6639,7 +6645,15 @@ init (xlator_t *this) _private->base_path); goto out; } + #ifdef __NetBSD__ + /* + * Make sure cores go to the root and not in current + * directory + */ + (void)sysctlbyname("proc.curproc.corename", NULL, NULL, + corename, strlen(corename) + 1); + /* * At least on NetBSD, the chdir() above uncovers a * race condition which cause file lookup to fail -- Emmanuel Dreyfus manu@xxxxxxxxxx _______________________________________________ Gluster-devel mailing list Gluster-devel@xxxxxxxxxxx http://www.gluster.org/mailman/listinfo/gluster-devel