File: swift-container.swift-container-sync.init

package info (click to toggle)
swift 2.2.0-1%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 7,652 kB
  • ctags: 8,973
  • sloc: python: 91,651; sh: 668; makefile: 49
file content (57 lines) | stat: -rw-r--r-- 1,254 bytes parent folder | download
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
#! /bin/sh
### BEGIN INIT INFO
# Provides:          swift-container-sync
# Required-Start:    $remote_fs
# Required-Stop:     $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Swift container sync server
# Description:       Container sync server for Swift.
### END INIT INFO

set -e

SERVICE_NAME="container-sync"
PRINT_NAME="container sync"

. /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 $?
	exit $?
;;
stop)
	log_daemon_msg "Stopping Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
	/usr/bin/swift-init ${SERVICE_NAME} stop
	log_end_msg $?
	exit $?
;;
restart)
	log_daemon_msg "Restarting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
	/usr/bin/swift-init ${SERVICE_NAME} restart
	log_end_msg $?
	exit $?
;;
reload|force-reload)
	log_daemon_msg "Gracefully restarting Swift ${PRINT_NAME}" "swift-init ${SERVICE_NAME}"
	/usr/bin/swift-init ${SERVICE_NAME} reload
	log_end_msg $?
	exit $?
;;
status)
	exec /usr/bin/swift-init ${SERVICE_NAME} status
;;
*)
	echo "Usage: $0 {start|stop|restart|reload}"
	exit 1
;;
esac

exit 0