-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenstack-swift-container
executable file
·72 lines (59 loc) · 1.28 KB
/
openstack-swift-container
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/sh
### BEGIN INIT INFO
# Provides: openstack-swift-container
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 3 5
# Default-Stop: 0 1 6
# Short-Description: Swift container server
# Description: Container server for swift.
### END INIT INFO
# openstack-swift-container: swift container server
#
# chkconfig: - 20 80
# description: Container server for swift.
. /etc/rc.status
#. /usr/share/openstack-swift/functions
name="container-server"
[ -e "/etc/sysconfig/openstack-swift-$name" ] && . "/etc/sysconfig/openstack-swift-$name"
lockfile="/var/lock/subsys/openstack-swift-$name"
start() {
swift-init $name start
retval=$?
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
swift-init $name stop
retval=$?
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
mkvarrun() {
test -d /var/run/swift || mkdir /var/run/swift
test -d /var/run/swift/${name} || mkdir /var/run/swift/${name}
}
mkvarrun
case "$1" in
start)
$1
;;
stop)
$1
;;
restart)
$1
;;
reload)
;;
status)
;;
*)
echo $"Usage: $0 {start|stop|status|restart}"
exit 2
esac
exit $?