diff options
Diffstat (limited to 'src/infra.gentoo.org/rsync-node/wrap_rsync.sh')
-rwxr-xr-x | src/infra.gentoo.org/rsync-node/wrap_rsync.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/infra.gentoo.org/rsync-node/wrap_rsync.sh b/src/infra.gentoo.org/rsync-node/wrap_rsync.sh index a7f87ed..dd3e2df 100755 --- a/src/infra.gentoo.org/rsync-node/wrap_rsync.sh +++ b/src/infra.gentoo.org/rsync-node/wrap_rsync.sh @@ -42,8 +42,14 @@ function sync() { # Function init does a first sync, to populate the serving partition and # setup symlinks, and begin serving data. +# Also, setup the tmpfs to be big enough. # "${1}" is the serving partition. "${2}" is the update partition function init() { + mount -o remount -o size=1.3g "${DEST_DIR}" + if [[ $? -ne 0 ]]; then + logger -t rsync "Init: Failed to resize tmpfs: ${DEST_DIR}" + return 1 + fi sync "${1}" "${SOURCE_MIRROR}" # this is synchronous. # We serve out of ${DEST_DIR}/serving @@ -53,6 +59,7 @@ function init() { # Then launch rsyncd; it will detach into the background and serve from serving. rsync --daemon --config="/opt/rsync/rsyncd.conf" + return 0 } # Function update syncs the 'update' partition and, if successful, swaps the partitions. @@ -82,5 +89,8 @@ function serve() { # Partition1 starts as "serving", partition2 as "update" init "${PARTITION1}" "${PARTITION2}" +if [[ $? -ne 0 ]]; then + exit 1 +fi # Serve forever serve |