#!/bin/sh ### BEGIN INIT INFO # Provides: openstack-swift-object-auditor # Required-Start: $remote_fs # Required-Stop: $remote_fs # Default-Stop: 0 1 6 # Short-Description: Swift object auditor # Description: Object auditor for swift. ### END INIT INFO # openstack-swift-object-auditor: swift object auditor # # chkconfig: - 98 02 # description: Object auditor for swift. . /etc/rc.d/init.d/functions . /usr/share/openstack-swift/functions name="object" subserv="auditor" identity="openstack-swift-object-auditor" [ -e "/etc/sysconfig/openstack-swift-$name" ] && . "/etc/sysconfig/openstack-swift-$name" lockfile="/var/lock/subsys/openstack-swift-$name-$subserv" start() { swift_action "$name" "$subserv" start "$identity" retval=$? [ $retval -eq 0 ] && touch $lockfile return $retval } stop() { swift_action "$name" "$subserv" stop "$identity" retval=$? [ $retval -eq 0 ] && rm -f $lockfile return $retval } restart() { stop start } rh_status() { swift_action "$name" "$subserv" status "$identity" } rh_status_q() { rh_status &> /dev/null } case "$1" in start) rh_status_q && exit 0 $1 ;; stop) rh_status_q || exit 0 $1 ;; restart) $1 ;; status) rh_status ;; condrestart|try-restart) rh_status_q || exit 0 restart ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart}" exit 2 esac exit $?