aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/unix/cli.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-07-20 19:17:06 +0200
committerDave Wallace <dwallacelf@gmail.com>2017-08-24 19:49:09 +0000
commit57d963f88b2c99e698e2b29f72e190f47f41b1ad (patch)
tree0a26d5fd1e09b4b997db5950fe9bf70835ab9798 /src/vlib/unix/cli.c
parentd48e9763bfc39106eca954a28223b72261bf1aeb (diff)
Make VPP runtime directory configurable
New startup config command: unix { runtime-dir /run/vpp } Also, adds recursive mkdir funtion for use in deifferent places like cli-config socket path and dpdk hugepage directory path. Change-Id: I1446ceab9c220c25804e73a743a3ebb383450124 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/unix/cli.c')
-rw-r--r--src/vlib/unix/cli.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/vlib/unix/cli.c b/src/vlib/unix/cli.c
index 1befa25def4..068a4e169dc 100644
--- a/src/vlib/unix/cli.c
+++ b/src/vlib/unix/cli.c
@@ -2642,15 +2642,19 @@ unix_cli_config (vlib_main_t * vm, unformat_input_t * input)
/* CLI listen. */
unix_file_t template = { 0 };
- /* If our listen address looks like a path and it starts with
- * VPP_RUN_DIR, go make sure VPP_RUN_DIR exists before trying to open
- * a socket in it.
- */
- if (strncmp (s->config, VPP_RUN_DIR "/", strlen (VPP_RUN_DIR) + 1) == 0)
+ /* mkdir of file socketu, only under /run */
+ if (strncmp (s->config, "/run", 4) == 0)
{
- error = unix_make_vpp_run_dir ();
- if (error)
- return error;
+ u8 *tmp = format (0, "%s", s->config);
+ int i = vec_len (tmp);
+ while (i && tmp[--i] != '/')
+ ;
+
+ tmp[i] = 0;
+
+ if (i)
+ vlib_unix_recursive_mkdir ((char *) tmp);
+ vec_free (tmp);
}
s->flags = SOCKET_IS_SERVER | /* listen, don't connect */