Skip to content
Permalink
Browse files

6391 Override default SPA config location via environment

Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Richard Yao <ryao@gentoo.org>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Will Andrews <will@freebsd.org>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
  • Loading branch information
imp authored and ahrens committed Nov 2, 2015
1 parent 57deb23 commit ae24175b2b25e9fb4bfd9ac0648b57e0735b6651
Showing with 10 additions and 0 deletions.
  1. +10 −0 usr/src/cmd/zdb/zdb.c
@@ -3530,12 +3530,22 @@ main(int argc, char **argv)
nvlist_t *policy = NULL;
uint64_t max_txg = UINT64_MAX;
int rewind = ZPOOL_NEVER_REWIND;
char *spa_config_path_env;

(void) setrlimit(RLIMIT_NOFILE, &rl);
(void) enable_extended_FILE_stdio(-1, -1);

dprintf_setup(&argc, argv);

/*
* If there is an environment variable SPA_CONFIG_PATH it overrides
* default spa_config_path setting. If -U flag is specified it will
* override this environment variable settings once again.
*/
spa_config_path_env = getenv("SPA_CONFIG_PATH");
if (spa_config_path_env != NULL)
spa_config_path = spa_config_path_env;

while ((c = getopt(argc, argv,
"bcdhilmMI:suCDRSAFLXx:evp:t:U:P")) != -1) {
switch (c) {

0 comments on commit ae24175

Please sign in to comment.
You can’t perform that action at this time.