1 |
commit: 2671b355b97553fbd6696dc82469630fdfcf58c9 |
2 |
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jul 13 21:36:43 2016 +0000 |
4 |
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jul 13 21:37:40 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2671b355 |
7 |
|
8 |
app-emulation/ganeti: make it easier to restart a downed cluster |
9 |
|
10 |
Package-Manager: portage-2.2.28 |
11 |
|
12 |
app-emulation/ganeti/files/ganeti.initd-r3 | 14 ++++++++++++++ |
13 |
1 file changed, 14 insertions(+) |
14 |
|
15 |
diff --git a/app-emulation/ganeti/files/ganeti.initd-r3 b/app-emulation/ganeti/files/ganeti.initd-r3 |
16 |
index a238aa1..e255354 100644 |
17 |
--- a/app-emulation/ganeti/files/ganeti.initd-r3 |
18 |
+++ b/app-emulation/ganeti/files/ganeti.initd-r3 |
19 |
@@ -3,6 +3,8 @@ |
20 |
# Distributed under the terms of the GNU General Public License v2 |
21 |
# $Id$ |
22 |
|
23 |
+extra_commands="forcestart is_master" |
24 |
+ |
25 |
depend() { |
26 |
need localmount logger |
27 |
after bootmisc sshd |
28 |
@@ -17,6 +19,17 @@ is_master() { |
29 |
[ "${ganeti_master}" = "${local_hostname}" ] |
30 |
} |
31 |
|
32 |
+# This exists specifically for restarting a 2-node cluster where quorum might |
33 |
+# not be available. |
34 |
+forcestart() { |
35 |
+ ewarn "Forcing non-quorum Ganeti master start" |
36 |
+ GANETI_WCONFD_OPTS="${GANETI_WCONFD_OPTS} --no-voting --yes-do-it" |
37 |
+ GANETI_LUXID_OPTS="${GANETI_LUXID_OPTS} --no-voting --yes-do-it" |
38 |
+ GANETI_MASTERD_OPTS="${GANETI_LUXID_OPTS} --no-voting --yes-do-it" |
39 |
+ export GANETI_WCONFD_OPTS GANETI_LUXID_OPTS GANETI_MASTERD_OPTS |
40 |
+ start |
41 |
+} |
42 |
+ |
43 |
start() { |
44 |
if ! [ -e ${DAEMON_UTIL} ]; then |
45 |
eerror "Could not find daemon utility at ${DAEMON_UTIL}" |
46 |
@@ -39,6 +52,7 @@ start() { |
47 |
|
48 |
ebegin "Starting ${daemon}" |
49 |
eindent |
50 |
+ veinfo ${DAEMON_UTIL} start ${daemon} ${GANETI_OPTS} ${daemon_opts} |
51 |
${DAEMON_UTIL} start ${daemon} ${GANETI_OPTS} ${daemon_opts} || retval=${?} |
52 |
|
53 |
if [ ${retval} != 0 ] && [ -n "${started_daemons}" ]; then |