Skip to content

Commit c0bdb20

Browse files
authored
Merge branch 'master' into containerize-travis
2 parents 83e79f1 + cacf109 commit c0bdb20

File tree

5 files changed

+49
-1
lines changed

5 files changed

+49
-1
lines changed

bin/ghe-restore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,28 @@ fi
200200
ghe-backup-store-version ||
201201
echo "Warning: storing backup-utils version remotely failed."
202202

203+
# Stop cron and timerd, as scheduled jobs may disrupt the restore process.
204+
if [ "$GHE_VERSION_MAJOR" -ge 2 ]; then
205+
echo "Stopping cron and github-timerd ..."
206+
if $cluster; then
207+
if ! ghe-ssh "$GHE_HOSTNAME" -- "ghe-cluster-each -- sudo service cron stop"; then
208+
ghe_verbose "* Warning: Failed to stop cron on one or more nodes"
209+
fi
210+
211+
if ! ghe-ssh "$GHE_HOSTNAME" -- "ghe-cluster-each -- sudo service github-timerd stop"; then
212+
ghe_verbose "* Warning: Failed to stop github-timerd on one or more nodes"
213+
fi
214+
else
215+
if ! ghe-ssh "$GHE_HOSTNAME" -- "sudo service cron stop"; then
216+
ghe_verbose "* Warning: Failed to stop cron"
217+
fi
218+
219+
if ! ghe-ssh "$GHE_HOSTNAME" -- "sudo service github-timerd stop"; then
220+
ghe_verbose "* Warning: Failed to stop github-timerd"
221+
fi
222+
fi
223+
fi
224+
203225
# Restore settings and license if restoring to an unconfigured appliance or when
204226
# specified manually.
205227
if $restore_settings; then
@@ -323,6 +345,20 @@ elif $instance_configured; then
323345
fi
324346
fi
325347

348+
# Start cron. Timerd will start automatically as part of the config run.
349+
if [ "$GHE_VERSION_MAJOR" -ge 2 ]; then
350+
echo "Starting cron ..."
351+
if $cluster; then
352+
if ! ghe-ssh "$GHE_HOSTNAME" -- "ghe-cluster-each -- sudo service cron start"; then
353+
echo "* Warning: Failed to start cron on one or more nodes"
354+
fi
355+
else
356+
if ! ghe-ssh "$GHE_HOSTNAME" -- "sudo service cron start"; then
357+
echo "* Warning: Failed to start cron"
358+
fi
359+
fi
360+
fi
361+
326362
# Update the remote status to "complete". This has to happen before importing
327363
# ssh host keys because subsequent commands will fail due to the host key
328364
# changing otherwise.

debian/changelog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
github-backup-utils (2.8.1) UNRELEASED; urgency=medium
2+
3+
* Stop cron and timerd during restore #269
4+
* Fix compatibility issue with older versions of OpenSSH #263
5+
6+
-- Sergio Rubio <[email protected]> Mon, 14 Nov 2016 22:04:48 +0100
7+
18
github-backup-utils (2.8.0) UNRELEASED; urgency=low
29

310
* Adds support for GitHub Enterprise 2.8.0

share/github-backup-utils/ghe-detect-leaked-ssh-keys

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ if $leaked_keys_found; then
124124
echo "* (An upgrade may be required)"
125125
echo
126126
fi
127+
else
128+
echo "* No leaked keys found"
127129
fi
128130

129131
# Cleanup temp dir

share/github-backup-utils/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.8.0
1+
2.8.1

test/bin/service

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
# Fake service command for tests.
3+
true

0 commit comments

Comments
 (0)