File openstack-swift-account.init of Package openstack-swift-doc
#!/bin/sh
### BEGIN INIT INFO
# Provides: openstack-swift-account
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 3 5
# Default-Stop: 0 1 6
# Short-Description: Swift account server
# Description: Account server for swift.
### END INIT INFO
# openstack-swift-account: swift account server
#
# chkconfig: - 20 80
# description: Account server for swift.
. /etc/rc.status
. /usr/share/openstack-swift/functions
name="account"
server="swift-$name-server"
config="/etc/swift/account-server.conf"
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 $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 # Not running is not a failure.
fi
;;
*)
echo $"Usage: $0 {start|stop|status|restart|try-restart}"
exit 2
esac
exit $?