Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 141899 | Differences between
and this patch

Collapse All | Expand All

(-)icecream.orig (-34 / +17 lines)
Lines 8-50 Link Here
8
8
9
start() {
9
start() {
10
10
11
	netname=
11
	local basedir=${ICECREAM_BASEDIR:-"/var/cache/icecream"}
12
	if test -n "$ICECREAM_NETNAME"; then
12
	local netname=${ICECREAM_NETNAME:+"-n ${ICECREAM_NETNAME}"}
13
		netname="-n $ICECREAM_NETNAME"
13
	local logfile=${ICECREAM_LOG_FILE:+"-l ${ICECREAM_LOG_FILE}"}
14
	fi
14
	local nice=${ICECREAM_NICE_LEVEL:+"-n ${ICECREAM_NICE_LEVEL}"}
15
	if test "$ICECREAM_RUN_SCHEDULER" == "yes"; then
15
	local scheduler=${ICECREAM_SCHEDULER_HOST:+"-s ${ICECREAM_SCHEDULER_HOST}"}
16
		logfile=""
16
	local maxjobs=${ICECREAM_MAX_JOBS:+"-m ${ICECREAM_MAX_JOBS}"}
17
		if test -z "$ICECREAM_SCHEDULER_LOG_FILE"; then
17
	local verbosity=${ICECREAM_VERBOSITY:-"-v"}
18
			ICECREAM_SCHEDULER_LOG_FILE="/var/log/icecc_scheduler"
18
	
19
		fi
19
	if [[ "${ICECREAM_RUN_SCHEDULER}" == "yes" ]]; then
20
		logfile="-l $ICECREAM_SCHEDULER_LOG_FILE"
20
		local slogfile=${ICECREAM_SCHEDULER_LOG_FILE:-"/var/log/icecc_scheduler"}
21
		: > $ICECREAM_SCHEDULER_LOG_FILE
21
		touch ${slogfile} && chown icecream:icecream ${slogfile}
22
		chown icecream:icecream $ICECREAM_SCHEDULER_LOG_FILE
22
		slogfile=${slogfile:+"-l ${slogfile}"}
23
		
24
		ebegin "Starting Distributed Compiler Scheduler"
23
		ebegin "Starting Distributed Compiler Scheduler"
25
	        start-stop-daemon -u icecream --start --quiet --exec /usr/sbin/scheduler -- -d $logfile $netname
24
		start-stop-daemon -u icecream --start --quiet --exec /usr/sbin/scheduler -- -d ${slogfile} ${netname} ${verbosity}
26
		eend ${?}
25
		eend ${?}
27
        fi
28
	logfile=""
29
	if test -n "$ICECREAM_LOG_FILE"; then
30
		logfile="-l $ICECREAM_LOG_FILE"
31
		: > $ICECREAM_LOG_FILE
32
		chown icecream:icecream $ICECREAM_LOG_FILE
33
	fi
34
	nice=
35
	if test -n "$ICECREAM_NICE_LEVEL"; then
36
		nice="--nice $ICECREAM_NICE_LEVEL"
37
	fi
38
	scheduler=
39
	if test -n "$ICECREAM_SCHEDULER_HOST"; then
40
		scheduler="-s $ICECREAM_SCHEDULER_HOST"
41
	fi
42
	maxjobs=
43
	if test -n "$ICECREAM_MAX_JOBS"; then
44
		maxjobs="-m $ICECREAM_MAX_JOBS"
45
	fi
26
	fi
27
28
	[[ ! -d ${basedir} ]] && mkdir -p ${basedir} && chown icecream:icecream ${basedir}
46
	ebegin "Starting Distributed Compiler Daemon"
29
	ebegin "Starting Distributed Compiler Daemon"
47
	start-stop-daemon --start --quiet --exec /usr/sbin/iceccd -- -d $logfile $nice $scheduler $netname -u icecream -b "$ICECREAM_BASEDIR" $maxjobs
30
	start-stop-daemon --start --quiet --exec /usr/sbin/iceccd -- -d ${logfile} ${nice} ${scheduler} ${netname} -u icecream -b "${basedir}" ${maxjobs} ${verbosity}
48
	eend ${?}
31
	eend ${?}
49
}
32
}
50
33
Lines 52-58 Link Here
52
	ebegin "Stopping Distributed Compiler Daemon"
35
	ebegin "Stopping Distributed Compiler Daemon"
53
	start-stop-daemon --stop --quiet --name iceccd
36
	start-stop-daemon --stop --quiet --name iceccd
54
	eend ${?}
37
	eend ${?}
55
	if test "$ICECREAM_RUN_SCHEDULER" == "yes"; then
38
	if [[ "${ICECREAM_RUN_SCHEDULER}" == "yes" ]]; then
56
		ebegin "Stopping Distributed Compiler Scheduler"
39
		ebegin "Stopping Distributed Compiler Scheduler"
57
		start-stop-daemon --stop --quiet --name scheduler
40
		start-stop-daemon --stop --quiet --name scheduler
58
		eend ${?}
41
		eend ${?}

Return to bug 141899