summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-swift/swift.init
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-swift/swift.init')
-rw-r--r--meta-openstack/recipes-devtools/python/python-swift/swift.init74
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
16DESC="Swift Cluster"
17SWIFT_HOME=/etc/swift
18SWIFT_INIT=/usr/bin/swift-init
19
20start ()
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
36stop ()
37{
38 echo -n "Stopping $DESC..."
39 $SWIFT_INIT all stop
40 /etc/swift/swift_setup.sh unmountdevs
41 echo "done."
42}
43
44
45status ()
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
54case "$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 ;;
72esac
73
74exit 0