summaryrefslogtreecommitdiff
blob: 1447b0910d63c819de5e2ebbcb4c7365b4a8ab7e (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
#!/sbin/runscript
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sci-biology/foldingathome/files/6.02/fah-init,v 1.2 2008/11/22 04:37:22 je_fro Exp $

opts="${opts} unitinfo"

unitinfo() {
	einfo "$(head -n1 /opt/foldingathome/amd64-smp/unitinfo.txt):"
	sed -e '1,2d' /opt/foldingathome/amd64-smp/unitinfo.txt
}

start() {
	ebegin "Starting Folding@Home"
	cd /opt/foldingathome/amd64-smp
	start-stop-daemon --chdir ${PWD} --chuid foldingathome --nicelevel 19 \
		--make-pidfile --pidfile "${PIDFILE}" \
		--start --background --exec ./fah6 -- ${FOLD_OPTS}
	eend $?
}

stop() {
	ebegin "Stopping Folding@Home"
	start-stop-daemon --stop --user foldingathome --pidfile "${PIDFILE}"
	eend $?
	killall --user foldingathome --signal SIGKILL
}