Fix mounting location at the right place.
Fix rerun of the script.
Start rsync.
Fix permissions.
... | ... |
@@ -623,10 +623,18 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]];then |
623 | 623 |
sudo mount ${s} |
624 | 624 |
fi |
625 | 625 |
|
626 |
+ for x in {1..4}; do sudo ln -sf $s/$x ${SWIFT_LOCATION}/$x; done |
|
627 |
+ |
|
626 | 628 |
# Create directories |
627 |
- sudo install -g stack -o stack -d /etc/swift /etc/swift/{object,container,account}-server \ |
|
628 |
- ${SWIFT_LOCATION}/{1..4}/node/sdb1 /var/run/swift ${s}/{1..4} |
|
629 |
+ tmpd="" |
|
630 |
+ for d in /etc/swift /etc/swift/{object,container,account}-server \ |
|
631 |
+ ${SWIFT_LOCATION}/{1..4}/node/sdb1 /var/run/swift ${s}/{1..4};do |
|
632 |
+ [[ -d $d ]] && continue |
|
633 |
+ sudo install -g stack -o stack -d $d |
|
634 |
+ done |
|
629 | 635 |
|
636 |
+ sudo chown -R stack: ${SWIFT_LOCATION}/{1..4}/node |
|
637 |
+ |
|
630 | 638 |
# Adjust rc.local to always have a /var/run/swift on reboot |
631 | 639 |
# created and chown to our user. |
632 | 640 |
# TODO (chmou): We may not have a "exit 0" |
... | ... |
@@ -638,8 +646,9 @@ exit 0 |
638 | 638 |
EOF |
639 | 639 |
|
640 | 640 |
# Add rsync file |
641 |
- sed -e "s/%SWIFT_LOCATION%/$SWIFT_LOCATION/" $FILES/swift-rsyncd.conf | sudo tee /etc/rsyncd.conf |
|
642 |
- |
|
641 |
+ sed -e "s,%SWIFT_LOCATION%,$SWIFT_LOCATION," $FILES/swift-rsyncd.conf | sudo tee /etc/rsyncd.conf |
|
642 |
+ sudo sed -i '/^RSYNC_ENABLE=false/ { s/false/true/ }' /etc/default/rsync |
|
643 |
+ |
|
643 | 644 |
# Copy proxy-server configuration |
644 | 645 |
cp $FILES/swift-proxy-server.conf /etc/swift/proxy-server.conf |
645 | 646 |
|
... | ... |
@@ -673,6 +682,9 @@ EOF |
673 | 673 |
sudo install -m755 $FILES/swift-startmain /usr/local/bin/ |
674 | 674 |
sudo chmod +x /usr/local/bin/swift-* |
675 | 675 |
|
676 |
+ # Start rsync |
|
677 |
+ sudo /etc/init.d/rsync restart || : |
|
678 |
+ |
|
676 | 679 |
# Create ring |
677 | 680 |
/usr/local/bin/swift-remakerings |
678 | 681 |
|