Merge pull request #203 from dcornejo/master
Add ability to enable core dumps from RESTCONF process
This commit is contained in:
commit
51df120e9e
2 changed files with 25 additions and 1 deletions
|
|
@ -138,6 +138,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/rand.h>
|
||||
|
|
@ -1448,6 +1449,21 @@ restconf_openssl_init(clicon_handle h,
|
|||
yang_spec_dump(clicon_dbspec_yang(h), dbg);
|
||||
}
|
||||
}
|
||||
if ((x = xpath_first(xrestconf, nsc, "enable-core-dump")) != NULL) {
|
||||
/* core dump is enabled on RESTCONF process */
|
||||
struct rlimit rlp;
|
||||
if (strcmp(xml_body(x), "true") == 0) {
|
||||
rlp.rlim_cur = RLIM_INFINITY;
|
||||
rlp.rlim_max = RLIM_INFINITY;
|
||||
} else {
|
||||
rlp.rlim_cur = 0;
|
||||
rlp.rlim_max = 0;
|
||||
}
|
||||
int status = setrlimit(RLIMIT_CORE, &rlp);
|
||||
if (status != 0) {
|
||||
clicon_log(LOG_NOTICE, "%s: setrlimit() failed, %s", __func__, strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
if (init_openssl() < 0)
|
||||
goto done;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue