diff options
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-swift/swift.init')
-rw-r--r-- | meta-openstack/recipes-devtools/python/python-swift/swift.init | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-swift/swift.init b/meta-openstack/recipes-devtools/python/python-swift/swift.init index cf120664..256e1d04 100644 --- a/meta-openstack/recipes-devtools/python/python-swift/swift.init +++ b/meta-openstack/recipes-devtools/python/python-swift/swift.init @@ -50,6 +50,30 @@ status () $SWIFT_INIT object-server status } +reset() +{ + stop + + CLUSTER_CONF=/etc/swift/cluster.conf + SWIFT_SETUP='/bin/bash /etc/swift/swift_setup.sh' + + $SWIFT_SETUP clean + + for i in `seq 1 3`; do + BACKING_FILE=/etc/swift/swift_backing_$i + if [ "x%SWIFT_BACKING_FILE_SIZE%" != "x0G" ]; then + truncate -s %SWIFT_BACKING_FILE_SIZE% $BACKING_FILE + fi + done + + $SWIFT_SETUP createrings + $SWIFT_SETUP formatdevs + $SWIFT_SETUP mountdevs + $SWIFT_SETUP -i "%CONTROLLER_IP%" adddevs + $SWIFT_SETUP unmountdevs + + start +} case "$1" in start) @@ -65,8 +89,11 @@ case "$1" in status) status ;; + reset) + reset + ;; *) - echo "Usage: swift {start|stop|force-reload|restart|status}" + echo "Usage: swift {start|stop|force-reload|restart|status|reset}" exit 1 ;; esac |