summaryrefslogtreecommitdiff
path: root/sys-cluster/swift/files/swift-object.initd
diff options
context:
space:
mode:
Diffstat (limited to 'sys-cluster/swift/files/swift-object.initd')
-rw-r--r--sys-cluster/swift/files/swift-object.initd35
1 files changed, 35 insertions, 0 deletions
diff --git a/sys-cluster/swift/files/swift-object.initd b/sys-cluster/swift/files/swift-object.initd
new file mode 100644
index 000000000000..59ec78ca039a
--- /dev/null
+++ b/sys-cluster/swift/files/swift-object.initd
@@ -0,0 +1,35 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+COMMAND=/usr/bin/swift-init
+PIDFILE=/run/swift/object-server.pid
+
+depend() {
+ after net
+}
+
+checkconfig() {
+ if [ ! -r /etc/swift/swift.conf ]; then
+ eerror "Missing required config file: /etc/swift/swift.conf"
+ return 1
+ fi
+ if [ ! -r /etc/swift/object-server.conf ]; then
+ eerror "Missing required config file: /etc/swift/object-server.conf"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return $?
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --quiet -i --pidfile ${PIDFILE} ${COMMAND} -- object start
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --quiet -i --pidfile ${PIDFILE} ${COMMAND} -- object stop
+ eend $?
+}