Revision d2baa21d
b/daemons/daemon-util.in | ||
---|---|---|
36 | 36 |
echo "@LOCALSTATEDIR@/run/ganeti/$1.pid" |
37 | 37 |
} |
38 | 38 |
|
39 |
# Checks whether the local machine is part of a cluster |
|
40 |
check_config() { |
|
41 |
local server_pem=@LOCALSTATEDIR@/lib/ganeti/server.pem |
|
42 |
local fname |
|
43 |
|
|
44 |
for fname in $server_pem; do |
|
45 |
if [[ ! -f $fname ]]; then |
|
46 |
echo "Missing configuration file $fname" >&2 |
|
47 |
return 1 |
|
48 |
fi |
|
49 |
done |
|
50 |
|
|
51 |
return 0 |
|
52 |
} |
|
53 |
|
|
39 | 54 |
# Checks whether daemon is running |
40 | 55 |
check() { |
41 | 56 |
if [[ "$#" -lt 1 ]]; then |
b/doc/examples/ganeti.initd.in | ||
---|---|---|
27 | 27 |
|
28 | 28 |
. /lib/lsb/init-functions |
29 | 29 |
|
30 |
check_config() { |
|
31 |
for fname in \ |
|
32 |
"@LOCALSTATEDIR@/lib/ganeti/server.pem" |
|
33 |
do |
|
34 |
if ! [ -f "$fname" ]; then |
|
35 |
log_end_msg 0 |
|
36 |
log_warning_msg "Config $fname not there, will not run." |
|
37 |
exit 0 |
|
38 |
fi |
|
39 |
done |
|
40 |
} |
|
41 |
|
|
42 | 30 |
check_exitcode() { |
43 | 31 |
RC=$1 |
44 | 32 |
case $RC in |
... | ... | |
80 | 68 |
} |
81 | 69 |
|
82 | 70 |
start_all() { |
83 |
check_config |
|
71 |
if ! $DAEMON_UTIL check-config; then |
|
72 |
log_warning_msg "Incomplete configuration, will not run." |
|
73 |
exit 0 |
|
74 |
fi |
|
75 |
|
|
84 | 76 |
for i in $NODED $MASTERD $CONFD $RAPI; do \ |
85 | 77 |
maybe_do "$1" start_action $i |
86 | 78 |
done |
... | ... | |
111 | 103 |
stop_all "$2" |
112 | 104 |
;; |
113 | 105 |
restart|force-reload) |
106 |
log_daemon_msg "Restarting $DESC" "$2" |
|
114 | 107 |
stop_all "$2" |
115 | 108 |
start_all "$2" |
116 | 109 |
;; |
Also available in: Unified diff