@@ -86,6 +86,19 @@ while true; do
86
86
esac
87
87
done
88
88
89
+ start_cron () {
90
+ echo " Starting cron ..."
91
+ if $CLUSTER ; then
92
+ if ! ghe-ssh " $GHE_HOSTNAME " -- " ghe-cluster-each -- sudo service cron start" ; then
93
+ echo " * Warning: Failed to start cron on one or more nodes"
94
+ fi
95
+ else
96
+ if ! ghe-ssh " $GHE_HOSTNAME " -- " sudo service cron start" ; then
97
+ echo " * Warning: Failed to start cron"
98
+ fi
99
+ fi
100
+ }
101
+
89
102
cleanup () {
90
103
if [ -n " $1 " ]; then
91
104
update_restore_status " $1 "
@@ -103,6 +116,10 @@ cleanup () {
103
116
fi
104
117
fi
105
118
119
+ if ! $CRON_RUNNING ; then
120
+ start_cron
121
+ fi
122
+
106
123
# Cleanup SSH multiplexing
107
124
ghe-ssh --clean
108
125
}
@@ -249,6 +266,7 @@ update_restore_status () {
249
266
fi
250
267
}
251
268
269
+ CRON_RUNNING=true
252
270
# Update remote restore state file and setup failure trap
253
271
trap " cleanup failed" EXIT
254
272
update_restore_status " restoring"
324
342
fi
325
343
fi
326
344
fi
327
-
345
+ CRON_RUNNING=false
328
346
329
347
# Restore settings and license if restoring to an unconfigured appliance or when
330
348
# specified manually.
@@ -492,16 +510,8 @@ if ! $RESTORE_SETTINGS; then
492
510
fi
493
511
494
512
# Start cron. Timerd will start automatically as part of the config run.
495
- echo " Starting cron ..."
496
- if $CLUSTER ; then
497
- if ! ghe-ssh " $GHE_HOSTNAME " -- " ghe-cluster-each -- sudo service cron start" ; then
498
- echo " * Warning: Failed to start cron on one or more nodes"
499
- fi
500
- else
501
- if ! ghe-ssh " $GHE_HOSTNAME " -- " sudo service cron start" ; then
502
- echo " * Warning: Failed to start cron"
503
- fi
504
- fi
513
+ start_cron
514
+ CRON_RUNNING=true
505
515
506
516
# Clean up all stale replicas on configured instances.
507
517
if ! $CLUSTER && $instance_configured ; then
0 commit comments