Skip to content

Commit 01f42a9

Browse files
committed
Revert "Merge pull request #700 from github/check-ro-filesystem"
This reverts commit 0aa36fd, reversing changes made to c1a2b87.
1 parent 872f656 commit 01f42a9

File tree

3 files changed

+1
-53
lines changed

3 files changed

+1
-53
lines changed

backup.config-example

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ GHE_NUM_SNAPSHOTS=10
3232
# disk space validation and software version checks on the backup-host will be disabled.
3333
#GHE_SKIP_CHECKS=false
3434

35-
# Cluster filesystem to check if it's writable as part of ghe-host-check
36-
# By default it is /data/user/tmp but can be updated if needed
37-
#GHE_FILE_SYSTEM_WRITE_CHECK="/data/user/tmp"
38-
3935
# The hostname of the GitHub appliance to restore. If you've set up a separate
4036
# GitHub appliance to act as a standby for recovery, specify its IP or hostname
4137
# here. The host to restore to may also be specified directly when running

bin/ghe-host-check

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ if [ $rc -ne 0 ]; then
8585
exit $rc
8686
fi
8787

88-
if [ -z "$CLUSTER" ]; then
89-
CLUSTER=false
90-
fi
88+
CLUSTER=false
9189
if ghe-ssh "$host" -- \
9290
"[ -f '$GHE_REMOTE_ROOT_DIR/etc/github/cluster' ]"; then
9391
CLUSTER=true
@@ -117,37 +115,6 @@ if [ -z "$version" ]; then
117115
exit 2
118116
fi
119117

120-
NON_WRITABLE=""
121-
# ensure all nodes are writable
122-
if [ "$CLUSTER" == "true" ] ; then
123-
if [ -z "$GHE_FILE_SYSTEM_WRITE_CHECK" ]; then
124-
if [ -d "/data/user/tmp" ]; then
125-
WRITE_CHECK_FILE="/data/user/tmp/test-ro-file.txt"
126-
else
127-
WRITE_CHECK_FILE="/tmp/test-ro-file.txt"
128-
fi
129-
else
130-
WRITE_CHECK_FILE="$GHE_FILE_SYSTEM_CHECK/test-ro-file.txt"
131-
fi
132-
133-
# Iterate through each node in the cluster
134-
nodes=$(ghe-ssh "$host" ghe-cluster-nodes)
135-
for node in $nodes; do
136-
if ! echo "set -o pipefail; ssh $node -- 'touch $WRITE_CHECK_FILE && rm $WRITE_CHECK_FILE'" | ghe-ssh "$host" /bin/bash; then
137-
echo "File system is not writeable or no permission on $node" 1>&2
138-
NON_WRITABLE+="$node "
139-
fi || true
140-
done
141-
# Display the comma-separated list of non-writable nodes
142-
if [ -n "$NON_WRITABLE" ]; then
143-
NON_WRITABLE=$(echo "$NON_WRITABLE" | sed 's/ /, /g; s/, $//')
144-
log_error "Error: Following nodes are non-writable - $NON_WRITABLE. Please make sure the filesystem for all GHES nodes are writable." 1>&2
145-
exit 1
146-
else
147-
log_info "All nodes are writable."
148-
fi
149-
fi
150-
151118
# Block restoring snapshots to older releases of GitHub Enterprise Server
152119
if [ -n "$GHE_RESTORE_SNAPSHOT_PATH" ]; then
153120
snapshot_version=$(cat $GHE_RESTORE_SNAPSHOT_PATH/version)

test/test-ghe-host-check.sh

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,3 @@ begin_test "ghe-host-check blocks restore to old release"
123123
! GHE_TEST_REMOTE_VERSION=$bu_version_major.$((bu_version_minor-1)).$bu_version_patch ghe-restore -v
124124
)
125125
end_test
126-
127-
# Check ghe-host-check detects RO file system
128-
begin_test "ghe-host-check fails when encountering RO file-system"
129-
(
130-
set -e
131-
132-
ghe-ssh "$GHE_HOSTNAME" -- 'mkdir -p "~/tmp"'
133-
# Remove write access in ~/tmp
134-
ghe-ssh "$GHE_HOSTNAME" -- 'chmod a-w -R "~/tmp"'
135-
136-
# File creation fails for CLUSTER
137-
! WRITE_CHECK_FILE="$HOME/tmp/test" CLUSTER=true GHE_ALLOW_REPLICA_BACKUP=no ghe-host-check
138-
WRITE_CHECK_FILE="$HOME/tmp/test" CLUSTER=false GHE_ALLOW_REPLICA_BACKUP=no ghe-host-check
139-
)
140-
end_test

0 commit comments

Comments
 (0)