File openstack-swift-proxy.init of Package openstack-swift

#!/bin/sh

### BEGIN INIT INFO
# Provides:          openstack-swift-proxy
# Required-Start:    $remote_fs
# Should-Start:      memcached
# Required-Stop:     $remote_fs
# Should-Stop:       memcached
# Default-Start:     3 5
# Default-Stop:      0 1 6
# Short-Description: Swift proxy server
# Description:       Account server for swift.
### END INIT INFO

# openstack-swift-proxy: swift proxy server
#
# chkconfig: - 20 80
# description: Proxy server for swift.

. /etc/rc.status
#. /usr/share/openstack-swift/functions

name="proxy-server"
server="swift-proxy-server"
config="/etc/swift/proxy-server.conf"
startup_log="/var/log/swift/proxy-server-startup.log"
CHUSER="-u swift"

[ -e "/etc/sysconfig/openstack-swift-$name" ] && . "/etc/sysconfig/openstack-swift-$name"


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)
        echo -n "Starting $server"
        startproc -l $startup_log $CHUSER /usr/bin/$server $config
        rc_status -v
        ;;
    stop)
        echo -n "Shutting down $server"
        killproc /usr/bin/$server
        rc_status -v
        ;;
    restart)
        $0 stop
        $0 start
        rc_status
        ;;
    reload)
        ;;
    status)
        echo -n "Checking $server"
        /sbin/checkproc /usr/bin/$server
        rc_status -v
        ;;
    condrestart|try-restart)
	$0 status
	if test $? = 0; then
		$0 restart
	else
		rc_reset
	fi
        ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart}"
        exit 2
esac
exit $?