summaryrefslogtreecommitdiffstats
path: root/glusterfsd/src/glusterfsd.c
diff options
context:
space:
mode:
authorAravinda VK <avishwan@redhat.com>2018-08-17 09:38:39 +0530
committerAmar Tumballi <amarts@redhat.com>2018-09-05 06:44:59 +0000
commit560bd8671f2f9ae17530ad1d23a209dc95d41f82 (patch)
tree61b355b7eba5f8b8decfbdd2f2c64ac574fc30dc /glusterfsd/src/glusterfsd.c
parent0590678d05473d40c8107be8cf5a66879f9d196f (diff)
New flag to glusterfsd binary to print libexec dir
New CLI option for `glusterfsd` binary to get the path of libexec directory. This helps glusterd2 to detect the installed path of `gsyncd` and other binaries. Usage: `glusterfsd --print-libexecdir` Updates: bz#1193929 Change-Id: I8c1a74afd9acec7ee7bd3deabed9d9f20fe3fb5f Signed-off-by: Aravinda VK <avishwan@redhat.com>
Diffstat (limited to 'glusterfsd/src/glusterfsd.c')
-rw-r--r--glusterfsd/src/glusterfsd.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index 12f561eb689..5cc4704ac95 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -173,6 +173,8 @@ static struct argp_option gf_options[] = {
"Print directory path in which statedumps shall be generated"},
{"print-logdir", ARGP_PRINT_LOGDIR_KEY, 0, OPTION_ARG_OPTIONAL,
"Print path of default log directory"},
+ {"print-libexecdir", ARGP_PRINT_LIBEXECDIR_KEY, 0, OPTION_ARG_OPTIONAL,
+ "Print path of default libexec directory"},
{"volfile-max-fetch-attempts", ARGP_VOLFILE_MAX_FETCH_ATTEMPTS, "0",
OPTION_HIDDEN, "Maximum number of attempts to fetch the volfile"},
@@ -974,6 +976,10 @@ parse_opts (int key, char *arg, struct argp_state *state)
cmd_args->print_logdir = _gf_true;
break;
+ case ARGP_PRINT_LIBEXECDIR_KEY:
+ cmd_args->print_libexecdir = _gf_true;
+ break;
+
case ARGP_MAC_COMPAT_KEY:
if (!arg)
arg = "on";
@@ -2076,7 +2082,7 @@ parse_cmdline (int argc, char *argv[], glusterfs_ctx_t *ctx)
argp_parse (&argp, argc, argv, ARGP_IN_ORDER, NULL, cmd_args);
if (cmd_args->print_xlatordir || cmd_args->print_statedumpdir ||
- cmd_args->print_logdir) {
+ cmd_args->print_logdir || cmd_args->print_libexecdir) {
/* Just print, nothing else to do */
goto out;
}
@@ -2694,6 +2700,11 @@ main (int argc, char *argv[])
goto out;
}
+ if (cmd->print_libexecdir) {
+ printf ("%s\n", LIBEXECDIR);
+ goto out;
+ }
+
if (cmd->print_netgroups) {
/* If this option is set we want to print & verify the file,
* set the return value (exit code in this case) and exit.