summaryrefslogtreecommitdiff
blob: 42507bebca778d31a0dfa9039dded7d9dc289d60 (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
#!/sbin/runscript
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-cluster/corosync/files/corosync.initd,v 1.3 2014/12/02 14:55:49 ultrabug Exp $

depend() {
	need net
	use logger
}

start() {
	configtest || return 1
	ebegin "Starting Corosync Cluster Engine"
	start-stop-daemon --start -q --exec /usr/sbin/corosync \
		--pidfile /var/run/corosync.pid --make-pidfile --background \
		-- -f
	eend $?
}

stop() {
	ebegin "Stopping Corosync Cluster Engine"
	start-stop-daemon --stop -q --pidfile /var/run/corosync.pid
	eend $?
}

configtest() {
	ebegin "Checking corosync configuration"
	test -f /etc/corosync/corosync.confs
	eend $? "failed, please create the corosync configuration file"
}