~openstack-ubuntu-packagers/swift/diablo

« back to all changes in this revision

Viewing changes to debian/swift-account.swift-account-replicator

  • Committer: Soren Hansen
  • Date: 2011-07-12 12:35:12 UTC
  • mfrom: (5.1.24 zigo)
  • Revision ID: soren@linux2go.dk-20110712123512-w1aas600984pyehn
Merge a whole bunch of changes from Thomas Goirand.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
# Description:       Account replicator for swift.
10
10
### END INIT INFO
11
11
 
12
 
/usr/bin/swift-init account-replicator $1
13
 
 
 
12
set -e
 
13
 
 
14
SERVICE_NAME="swift-account-replicator"
 
15
DAEMON="/usr/bin/${SERVICE_NAME}"
 
16
DAEMON_ARGS="/etc/swift/account-server.conf"
 
17
PRINT_NAME="Swift account replicator"
 
18
SWIFT_USER=swift
 
19
SWIFT_GRP=swift
 
20
PID_FILE=/var/run/swift/${SERVICE_NAME}.pid
 
21
PID_DIR=`dirname $PID_FILE`
 
22
 
 
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}
 
34
 
 
35
. /lib/lsb/init-functions
 
36
 
 
37
case "$1" in
 
38
start)
 
39
        log_daemon_msg "Starting ${PRINT_NAME=}" "${SERVICE_NAME}"
 
40
        start-stop-daemon --start --chuid ${SWIFT_USER}:${SWIFT_GRP} -b -m --pidfile $PID_FILE --exec ${DAEMON} -- ${DAEMON_ARGS}
 
41
        log_end_msg $?
 
42
;;
 
43
stop)
 
44
        log_daemon_msg "Stopping ${PRINT_NAME}" "${SERVICE_NAME}"
 
45
        start-stop-daemon --stop --oknodo --pidfile ${PID_FILE}
 
46
        log_end_msg $?                          
 
47
;;                    
 
48
restart|force-reload|reload)
 
49
        $0 stop             
 
50
        sleep 1
 
51
        $0 start
 
52
;;              
 
53
*)
 
54
        echo "Usage: $0 {start|stop|restart|reload|force-reload}"
 
55
        exit 1                                      
 
56
;;            
 
57
esac
 
58
    
 
59
exit 0