summaryrefslogtreecommitdiffstats
path: root/src/vlib/unix/unix.h
diff options
context:
space:
mode:
authorChris Luke <chrisy@flirble.org>2017-07-05 18:02:53 -0400
committerDamjan Marion <dmarion.lists@gmail.com>2017-07-06 13:26:23 +0000
commit475674ee5aa4e130a0ac0caf08ef9d579b8604b7 (patch)
tree250d539bd4838c3a8d33a1a4707860ffd5e78b0c /src/vlib/unix/unix.h
parent31e59d9b01a04d734553136fdbd9e570b5241faf (diff)
unix: mkdir VPP_RUN_DIR before opening a socket in it
Change https://gerrit.fd.io/r/#/c/7230/ added a Unix domain CLI socket in the default startup.conf; however unless you had previously run VPP with the DPDK plugin enabled the directory that it is created in. /run/vpp, would not exist and startup would fail. This directory is typically hosted in a tmpfs ramdisk and is thus ephemeral. This patch adds a function that attempts to mkdir VPP_RUN_DIR and uses it in both the DPDK plugin and the CLI code if the CLI socket is to be created in that directory. Change-Id: Ibbf925819099dce2b5eb0fa238b9edca1036d6fd Signed-off-by: Chris Luke <chrisy@flirble.org>
Diffstat (limited to 'src/vlib/unix/unix.h')
-rw-r--r--src/vlib/unix/unix.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vlib/unix/unix.h b/src/vlib/unix/unix.h
index de607c0f490..ffa92bba1dc 100644
--- a/src/vlib/unix/unix.h
+++ b/src/vlib/unix/unix.h
@@ -43,6 +43,10 @@
#include <vppinfra/socket.h>
#include <termios.h>
+
+/** VPP runtime ephemeral directory. Typically stored in a tmpfs. */
+#define VPP_RUN_DIR "/run/vpp"
+
struct unix_file;
typedef clib_error_t *(unix_file_function_t) (struct unix_file * f);
@@ -229,6 +233,8 @@ clib_error_t *foreach_directory_file (char *dir_name,
u8 * file_name),
void *arg, int scan_dirs);
+clib_error_t *unix_make_vpp_run_dir (void);
+
#endif /* included_unix_unix_h */
/*