View | Details | Raw Unified | Return to bug 254006
Collapse All | Expand All

(-)samba_server (+16 lines)
Lines 126-136 Link Here
126
	rcvar=${name}_enable
126
	rcvar=${name}_enable
127
	command="/usr/local/sbin/${name}"
127
	command="/usr/local/sbin/${name}"
128
	pidfile="${samba_server_piddir}/${name}.pid"
128
	pidfile="${samba_server_piddir}/${name}.pid"
129
	masterpid=""
130
	if [ "${rc_arg}" = "stop" ] ; then
131
	    masterpid="`cat ${pidfile}`"
132
	fi
133
	
129
	# Daemon should be enabled and running
134
	# Daemon should be enabled and running
130
	if ( [ -n "${rcvar}" ] && checkyesno "${rcvar}" ) || [ -n "$force_run" ]; then
135
	if ( [ -n "${rcvar}" ] && checkyesno "${rcvar}" ) || [ -n "$force_run" ]; then
131
	    run_rc_command "${_rc_prefix}${rc_arg}" ${rc_extra_args}
136
	    run_rc_command "${_rc_prefix}${rc_arg}" ${rc_extra_args}
132
	    # If any of the commands failed, take it as a global result
137
	    # If any of the commands failed, take it as a global result
133
	    result=$((${result} || $?))
138
	    result=$((${result} || $?))
139
140
	    if [ "${rc_arg}" = "stop" -a "$masterpid" != "" ] ; then
141
		if pgrep -q -x -s "$masterpid"; then
142
		    echo -n "Waiting for all ${name} subprocesses to terminate..."
143
		    while pgrep -q -x -s "$masterpid"; do
144
			echo -n "."
145
			sleep 1
146
		    done
147
		    echo ""
148
		fi
149
	    fi
134
	fi
150
	fi
135
    done
151
    done
136
    return ${result}
152
    return ${result}

Return to bug 254006