summaryrefslogtreecommitdiffstats
path: root/sys-cluster/glusterfs/files/glusterd-r2.initd
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2019-09-01 00:00:32 +0200
committerSuren A. Chilingaryan <csa@suren.me>2019-09-01 00:00:32 +0200
commitca9627e70852f6b2e835660df870fe3ab405882d (patch)
tree0a008b1d5b16fa0679a195ed7b5662c7891f591c /sys-cluster/glusterfs/files/glusterd-r2.initd
downloaddarklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.gz
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.bz2
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.xz
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.zip
Initial import
Diffstat (limited to 'sys-cluster/glusterfs/files/glusterd-r2.initd')
-rw-r--r--sys-cluster/glusterfs/files/glusterd-r2.initd33
1 files changed, 33 insertions, 0 deletions
diff --git a/sys-cluster/glusterfs/files/glusterd-r2.initd b/sys-cluster/glusterfs/files/glusterd-r2.initd
new file mode 100644
index 0000000..bd33651
--- /dev/null
+++ b/sys-cluster/glusterfs/files/glusterd-r2.initd
@@ -0,0 +1,33 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+description="Gluster elastic volume management daemon"
+command="/usr/sbin/glusterd"
+pidfile="/var/run/${SVCNAME}.pid"
+command_args="-N"
+
+command_background="yes"
+
+depend() {
+ need net
+ before netmount
+}
+
+start_pre() {
+ # Ensure that the GlusterFS auxiliary mount parent directory exists
+ checkpath --directory --owner root:root --mode 0700 /var/run/gluster
+}
+
+start_post() {
+ local c=0
+ ebegin "Waiting for glusterd to start up"
+ while ! /usr/sbin/gluster volume list &>/dev/null && [ "${c}" -lt "${glusterd_max_wait_start-60}" ]; do
+ (( ++c ))
+ done
+ [ "${c}" -lt "${glusterd_max_wait_start-60}" ]
+ eend $?
+
+ return 0
+}