/[vps]/baselayout-vserver/branches/baselayout-1_12/sbin/rc-services.sh
Gentoo

Diff of /baselayout-vserver/branches/baselayout-1_12/sbin/rc-services.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 202 Revision 203
285# fi 285# fi
286begin_service() { 286begin_service() {
287 local service="$1" 287 local service="$1"
288 [[ -z ${service} ]] && return 1 288 [[ -z ${service} ]] && return 1
289 289
290 [[ ${START_CRITICAL} == "yes" ]] && return 0 290 [[ ${START_CRITICAL} == "yes" || ${STOP_CRITICAL} == "yes" ]] && return 0
291 291
292 mkfifo "${svcdir}/exclusive/${service}" 2> /dev/null 292 mkfifo "${svcdir}/exclusive/${service}" 2> /dev/null
293} 293}
294 294
295# void end_service(service, exitcode) 295# void end_service(service, exitcode)
300end_service() { 300end_service() {
301 local service="$1" exitstatus="$2" 301 local service="$1" exitstatus="$2"
302 [[ -z ${service} ]] && return 302 [[ -z ${service} ]] && return
303 303
304 # if we are doing critical services, there is no fifo 304 # if we are doing critical services, there is no fifo
305 [[ ${START_CRITICAL} == "yes" ]] && return 305 [[ ${START_CRITICAL} == "yes" || ${STOP_CRITICAL} == "yes" ]] && return
306 306
307 if [[ -n ${exitstatus} ]] ; then 307 if [[ -n ${exitstatus} ]] ; then
308 echo "${exitstatus}" > "${svcdir}/exitcodes/${service}" 308 echo "${exitstatus}" > "${svcdir}/exitcodes/${service}"
309 fi 309 fi
310 310
334 [[ ${START_CRITICAL} == "yes" || ${STOP_CRITICAL} == "yes" ]] && return 0 334 [[ ${START_CRITICAL} == "yes" || ${STOP_CRITICAL} == "yes" ]] && return 0
335 [[ ! -e ${fifo} ]] && return 0 335 [[ ! -e ${fifo} ]] && return 0
336 336
337 # This will block until the service fifo is touched 337 # This will block until the service fifo is touched
338 # Otheriwse we don't block 338 # Otheriwse we don't block
339 local tmp=$( < "${fifo}" &>/dev/null ) 339 $( < "${fifo}" &>/dev/null )
340 local exitstatus=$( < "${svcdir}/exitcodes/${service}" ) 340 local exitstatus=$( < "${svcdir}/exitcodes/${service}" )
341 341
342 return "${exitstatus}" 342 return "${exitstatus}"
343} 343}
344 344

Legend:
Removed from v.202  
changed lines
  Added in v.203

  ViewVC Help
Powered by ViewVC 1.1.20