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;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@ module clixon-restconf {
|
|||
|
||||
revision 2021-03-15 {
|
||||
description
|
||||
"make authentication-type none a feature";
|
||||
"make authentication-type none a feature
|
||||
Added flag to enable core dumps";
|
||||
}
|
||||
revision 2020-12-30 {
|
||||
description
|
||||
|
|
@ -127,6 +128,13 @@ module clixon-restconf {
|
|||
type uint32;
|
||||
default 0;
|
||||
}
|
||||
leaf enable-core-dump {
|
||||
description
|
||||
"enable core dumps.
|
||||
this is a no-op on systems that don't support it.";
|
||||
type boolean;
|
||||
default false;
|
||||
}
|
||||
leaf pretty {
|
||||
type boolean;
|
||||
default true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue