diff options
| author | Vu Tran <vu.tran@windriver.com> | 2014-04-09 19:59:09 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2014-04-11 14:15:28 -0400 |
| commit | 322d51de8417142c6ffbf024b198b26069a53f46 (patch) | |
| tree | 7dc20eedcd969ecff64b57061a5263387fe1b424 /meta-openstack/recipes-devtools/python/python-swift/swift.init | |
| parent | c173214e9c25409944144c9b4bd9892949a834ba (diff) | |
| download | meta-cloud-services-322d51de8417142c6ffbf024b198b26069a53f46.tar.gz | |
swift: add setup package
Introduce swift setup package. At boot time, this
package setups a simple swift cluster including:
* 3 zones
* each zone has 1 storage device which are based
on loopback devices which the backing files size
is controlled by variable SWIFT_BACKING_FILE_SIZE
The script /etc/swift/swift_setup.sh is also provided to ease
the task of setting up a complicated Swift cluster. It reads a
cluster config file, which describes what storage devices are
included in what rings, and constructs the cluster.
For details of how to use swift_setup.sh and the format
of Swift cluster config file please refer to the
script's help:
$ swift_setup.sh
Signed-off-by: Vu Tran <vu.tran@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-swift/swift.init')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-swift/swift.init | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-swift/swift.init b/meta-openstack/recipes-devtools/python/python-swift/swift.init new file mode 100644 index 0000000..cf12066 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-swift/swift.init | |||
| @@ -0,0 +1,74 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # chkconfig: 2345 20 20 | ||
| 4 | |||
| 5 | ### BEGIN INIT INFO | ||
| 6 | # Provides: swift-openstack | ||
| 7 | # Required-Start: $remote_fs $syslog | ||
| 8 | # Required-Stop: $remote_fs $syslog | ||
| 9 | # Default-Start: 3 5 | ||
| 10 | # Default-Stop: 0 1 2 6 | ||
| 11 | # Short-Description: OpenStack Swift | ||
| 12 | # Description: OpenStack Swift | ||
| 13 | ### END INIT INFO | ||
| 14 | |||
| 15 | |||
| 16 | DESC="Swift Cluster" | ||
| 17 | SWIFT_HOME=/etc/swift | ||
| 18 | SWIFT_INIT=/usr/bin/swift-init | ||
| 19 | |||
| 20 | start () | ||
| 21 | { | ||
| 22 | echo -n "Starting $DESC..." | ||
| 23 | if [ ! -e $SWIFT_HOME/account.builder -a ! -e $SWIFT_HOME/container.builder -a ! -e $SWIFT_HOME/object.builder ]; then | ||
| 24 | echo "no Swift cluster has been setup, failed." | ||
| 25 | exit 1 | ||
| 26 | fi | ||
| 27 | /etc/swift/swift_setup.sh mountdevs | ||
| 28 | $SWIFT_INIT proxy-server start | ||
| 29 | $SWIFT_INIT account-server start | ||
| 30 | $SWIFT_INIT container-server start | ||
| 31 | $SWIFT_INIT object-server start | ||
| 32 | echo "done." | ||
| 33 | } | ||
| 34 | |||
| 35 | |||
| 36 | stop () | ||
| 37 | { | ||
| 38 | echo -n "Stopping $DESC..." | ||
| 39 | $SWIFT_INIT all stop | ||
| 40 | /etc/swift/swift_setup.sh unmountdevs | ||
| 41 | echo "done." | ||
| 42 | } | ||
| 43 | |||
| 44 | |||
| 45 | status () | ||
| 46 | { | ||
| 47 | $SWIFT_INIT proxy-server status | ||
| 48 | $SWIFT_INIT account-server status | ||
| 49 | $SWIFT_INIT container-server status | ||
| 50 | $SWIFT_INIT object-server status | ||
| 51 | } | ||
| 52 | |||
| 53 | |||
| 54 | case "$1" in | ||
| 55 | start) | ||
| 56 | start | ||
| 57 | ;; | ||
| 58 | stop) | ||
| 59 | stop | ||
| 60 | ;; | ||
| 61 | restart|force-reload) | ||
| 62 | stop | ||
| 63 | start | ||
| 64 | ;; | ||
| 65 | status) | ||
| 66 | status | ||
| 67 | ;; | ||
| 68 | *) | ||
| 69 | echo "Usage: swift {start|stop|force-reload|restart|status}" | ||
| 70 | exit 1 | ||
| 71 | ;; | ||
| 72 | esac | ||
| 73 | |||
| 74 | exit 0 | ||
