1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

vgchange: Prompt when setting VG cluster attr if cluster is not setup

If clvmd is not running or the locking type is not clustered and someone
attempts to set the cluster attribute on a volume group, prompt them to
see if they are sure.  (Only prompt for one though.  If neither are true,
simply ask them once.)
This commit is contained in:
Jonathan Brassow 2014-06-05 22:27:40 -05:00
parent de12310c45
commit 9399b74356

View File

@ -317,6 +317,21 @@ static int _vgchange_clustered(struct cmd_context *cmd,
return 0;
}
if (clustered) {
if (!dm_daemon_is_running(CLVMD_PIDFILE)) {
if (yes_no_prompt("LVM cluster daemon (clvmd) is not"
" running.\n"
"Make volume group \"%s\" clustered"
" anyway? [y/n]: ", vg->name) == 'n')
return 0;
} else if (!locking_is_clustered() &&
(yes_no_prompt("LVM locking type is not clustered.\n"
"Make volume group \"%s\" clustered"
" anyway? [y/n]: ", vg->name) == 'n'))
return 0;
}
if (!vg_set_clustered(vg, clustered))
return_0;