mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
6391 Override default SPA config location via environment
illumos/illumos-gate@ae24175b2bae24175b2bhttps://www.illumos.org/issues/6391 When using zdb with non-default SPA config file it is not convenient to add -U <non-default-config-file-path> all the time. This commit introduces support for setting/overriding SPA config location via environment variable 'SPA_CONFIG_PATH'. If -U flag is specified in the command line it will override any other value as usual.64d7b6cf75Reviewed 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> Author: Cyril Plisko <cyril.plisko@mountall.com>
This commit is contained in:
parent
6c910ac2c4
commit
0442be9aa8
1 changed files with 10 additions and 0 deletions
|
|
@ -3529,12 +3529,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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue