summaryrefslogtreecommitdiff
blob: 8d4d7b8257af3659acb2ea28a556b29d27ae151c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/sbin/runscript
# 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
}