Fix mounting location at the right place.
Fix rerun of the script.
Start rsync.
Fix permissions.
This commit is contained in:
Chmouel Boudjnah 2011-11-01 17:32:11 +01:00
parent d5651bb5c6
commit e1d2bcb1b9

View file

@ -623,9 +623,17 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]];then
sudo mount ${s}
fi
for x in {1..4}; do sudo ln -sf $s/$x ${SWIFT_LOCATION}/$x; done
# Create directories
sudo install -g stack -o stack -d /etc/swift /etc/swift/{object,container,account}-server \
${SWIFT_LOCATION}/{1..4}/node/sdb1 /var/run/swift ${s}/{1..4}
tmpd=""
for d in /etc/swift /etc/swift/{object,container,account}-server \
${SWIFT_LOCATION}/{1..4}/node/sdb1 /var/run/swift ${s}/{1..4};do
[[ -d $d ]] && continue
sudo install -g stack -o stack -d $d
done
sudo chown -R stack: ${SWIFT_LOCATION}/{1..4}/node
# Adjust rc.local to always have a /var/run/swift on reboot
# created and chown to our user.
@ -638,7 +646,8 @@ exit 0
EOF
# Add rsync file
sed -e "s/%SWIFT_LOCATION%/$SWIFT_LOCATION/" $FILES/swift-rsyncd.conf | sudo tee /etc/rsyncd.conf
sed -e "s,%SWIFT_LOCATION%,$SWIFT_LOCATION," $FILES/swift-rsyncd.conf | sudo tee /etc/rsyncd.conf
sudo sed -i '/^RSYNC_ENABLE=false/ { s/false/true/ }' /etc/default/rsync
# Copy proxy-server configuration
cp $FILES/swift-proxy-server.conf /etc/swift/proxy-server.conf
@ -673,6 +682,9 @@ EOF
sudo install -m755 $FILES/swift-startmain /usr/local/bin/
sudo chmod +x /usr/local/bin/swift-*
# Start rsync
sudo /etc/init.d/rsync restart || :
# Create ring
/usr/local/bin/swift-remakerings