~openstack-ubuntu-testing/swift/raring-grizzly

1 by Soren Hansen
Import current packaging.
1
#! /bin/sh
2
### BEGIN INIT INFO
3
# Provides:          swift-object-updater
4
# Required-Start:    $remote_fs
5
# Required-Stop:     $remote_fs
6
# Default-Start:     2 3 4 5
7
# Default-Stop:      0 1 6
8
# Short-Description: Swift object updater server
9
# Description:       Object updater server for swift.
10
### END INIT INFO
11
5.1.20 by zigo at debian
Added default container-server.conf & object-server.conf files.
12
set -e
13
14
SERVICE_NAME="swift-object-updater"
15
DAEMON="/usr/bin/${SERVICE_NAME}"
16
DAEMON_ARGS="/etc/swift/object-server.conf"
17
PRINT_NAME="Swift object updater"
18
SWIFT_USER=swift
19
SWIFT_GRP=swift
20
PID_FILE=/var/run/swift/${SERVICE_NAME}.pid
21
PID_DIR=`dirname $PID_FILE`
40 by Soren Hansen
Fix up some indentation in the init scripts, and finish adding status support to the rest of the init scripts (in the first go, I only looked at *.init)
22
5.1.20 by zigo at debian
Added default container-server.conf & object-server.conf files.
23
if ! [ -x "${DAEMON}" ] ; then
24
	exit 0
25
fi
26
27
if ! [ -r "${DAEMON_ARGS}" ] ; then
28
	echo "No configuration file found in ${DAEMON_ARGS}: exiting"
29
	exit 0
30
fi
31
32
mkdir -p ${PID_DIR}
33
chown ${SWIFT_USER} ${PID_DIR}
5.1.10 by Thomas Goirand
Some more init.d script tweaks to be policy compliant.
34
35
. /lib/lsb/init-functions
36
37
case "$1" in
38
start)
40 by Soren Hansen
Fix up some indentation in the init scripts, and finish adding status support to the rest of the init scripts (in the first go, I only looked at *.init)
39
	log_daemon_msg "Starting ${PRINT_NAME}" "${SERVICE_NAME}"
5.1.20 by zigo at debian
Added default container-server.conf & object-server.conf files.
40
	start-stop-daemon --start --chuid ${SWIFT_USER}:${SWIFT_GRP} -b -m --pidfile $PID_FILE --exec ${DAEMON} -- ${DAEMON_ARGS}
5.1.10 by Thomas Goirand
Some more init.d script tweaks to be policy compliant.
41
	log_end_msg $?
42
;;
43
stop)
5.1.20 by zigo at debian
Added default container-server.conf & object-server.conf files.
44
	log_daemon_msg "Stopping ${PRINT_NAME}" "${SERVICE_NAME}"
45
	start-stop-daemon --stop --oknodo --pidfile ${PID_FILE}
5.1.10 by Thomas Goirand
Some more init.d script tweaks to be policy compliant.
46
	log_end_msg $?
47
;;
48
restart|force-reload|reload)
49
	$0 stop
50
	sleep 1
51
	$0 start
52
;;
40 by Soren Hansen
Fix up some indentation in the init scripts, and finish adding status support to the rest of the init scripts (in the first go, I only looked at *.init)
53
status)
54
	status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
55
;;
5.1.10 by Thomas Goirand
Some more init.d script tweaks to be policy compliant.
56
*)
57
	echo "Usage: $0 {start|stop|restart|reload}"
58
	exit 1
59
;;
60
esac
61
62
exit 0