diff options
Diffstat (limited to 'init.c')
-rw-r--r-- | init.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -36,6 +36,7 @@ #include "ps.h" #include "lladdr.h" #include "ping.h" +#include "mstats.h" #include "memdbg.h" @@ -815,6 +816,22 @@ init_static (void) } #endif +#ifdef MSTATS_TEST + { + int i; + mstats_open("/dev/shm/mstats.dat"); + for (i = 0; i < 30; ++i) + { + mmap_stats->n_clients += 1; + mmap_stats->link_write_bytes += 8; + mmap_stats->link_read_bytes += 16; + sleep(1); + } + mstats_close(); + return false; + } +#endif + return true; } @@ -1014,6 +1031,11 @@ do_uid_gid_chroot (struct context *c, bool no_delay) msg (M_INFO, "NOTE: UID/GID downgrade %s", why_not); } +#ifdef ENABLE_MEMSTATS + if (c->options.memstats_fn) + mstats_open(c->options.memstats_fn); +#endif + #ifdef HAVE_SETCON /* Apply a SELinux context in order to restrict what OpenVPN can do * to _only_ what it is supposed to do after initialization is complete |