-
Notifications
You must be signed in to change notification settings - Fork 0
/
swift-container.init
45 lines (40 loc) · 1.01 KB
/
swift-container.init
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
#! /bin/sh
### BEGIN INIT INFO
# Provides: swift-container
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Swift container server
# Description: Container server for swift.
### END INIT INFO
SERVICE_NAME="container-server"
PRINT_NAME="container server"
. /lib/lsb/init-functions
if ! [ -x /usr/bin/swift-init ] ; then
exit 0
fi
case "$1" in
start)
log_daemon_msg "Starting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
/usr/bin/swift-init ${SERVICE_NAME} start
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
/usr/bin/swift-init ${SERVICE_NAME} stop
log_end_msg $?
;;
restart|force-reload|reload)
log_daemon_msg "Restarting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
/usr/bin/swift-init ${SERVICE_NAME} reload
;;
status)
exec /usr/bin/swift-init ${SERVICE_NAME} status
;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
;;
esac
exit 0