/[baselayout]/trunk/sbin/runscript.sh
Gentoo

Contents of /trunk/sbin/runscript.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2141 - (show annotations) (download) (as text)
Sun Jul 9 13:21:53 2006 UTC (12 years, 3 months ago) by uberlord
File MIME type: text/x-sh
File size: 18398 byte(s)
Stop inactive dependencies too
1 #!/bin/bash
2 # Copyright 1999-2006 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4
5 # Common functions
6 [[ ${RC_GOT_FUNCTIONS} != "yes" ]] && source /sbin/functions.sh
7
8 # User must be root to run most script stuff (except status)
9 if [[ ${EUID} != "0" ]] && ! [[ $2 == "status" && $# -eq 2 ]] ; then
10 eerror "$0: must be root to run init scripts"
11 exit 1
12 fi
13
14 myscript="$1"
15 if [[ -L $1 && ! -L "/etc/init.d/${1##*/}" ]] ; then
16 SVCNAME=$(readlink "$1")
17 else
18 SVCNAME="$1"
19 fi
20
21 declare -r SVCNAME="${SVCNAME##*/}"
22 export SVCNAME
23 # Support deprecated myservice variable
24 myservice="${SVCNAME}"
25
26 svc_trap() {
27 trap 'eerror "ERROR: ${SVCNAME} caught an interrupt"; exit 1' \
28 INT QUIT TSTP
29 }
30
31 # Setup a default trap
32 svc_trap
33
34 # coldplug events can trigger init scripts, but we don't want to run them
35 # until after rc sysinit has completed so we punt them to the boot runlevel
36 if [[ -e /dev/.rcsysinit ]] ; then
37 eerror "ERROR: cannot run ${SVCNAME} until sysinit completes"
38 [[ ${RC_COLDPLUG:-yes} != "yes" ]] && exit 1
39 set -f
40 for x in ${RC_PLUG_SERVICES} ; do
41 [[ ${SVCNAME} == ${x} ]] && break
42 [[ "!${SVCNAME}" == ${x} ]] && exit 1
43 done
44 eerror "${SVCNAME} will be started in the ${BOOTLEVEL} runlevel"
45 if [[ ! -L /dev/.rcboot/"${SVCNAME}" ]] ; then
46 [[ ! -d /dev/.rcboot ]] && mkdir /dev/.rcboot
47 ln -snf "$1" /dev/.rcboot/"${SVCNAME}"
48 fi
49 exit 1
50 fi
51
52 # Only hotplug if we're allowed to
53 if [[ ${IN_HOTPLUG} == "1" ]] ; then
54 if [[ ${RC_HOTPLUG:-yes} != "yes" ]] ; then
55 eerror "${SVCNAME} is not allowed to be hotplugged"
56 exit 1
57 fi
58
59 set -f
60 for x in ${RC_PLUG_SERVICES} ; do
61 [[ ${SVCNAME} == ${x} ]] && break
62 if [[ "!${SVCNAME}" == ${x} ]] ; then
63 eerror "${SVCNAME} is not allowed to be hotplugged"
64 exit 1
65 fi
66 done
67 set +f
68 fi
69
70 # State variables
71 svcpause="no"
72 svcrestart="no"
73
74 # Functions to handle dependencies and services
75 [[ ${RC_GOT_SERVICES} != "yes" ]] && source "${svclib}/sh/rc-services.sh"
76 # Functions to control daemons
77 [[ ${RC_GOT_DAEMON} != "yes" ]] && source "${svclib}/sh/rc-daemon.sh"
78
79 # Check if the textdomain is non-default
80 search_lang="${LC_ALL:-${LC_MESSAGES:-${LANG}}}"
81 [[ -f ${TEXTDOMAINDIR}/${search_lang%.*}/LC_MESSAGES/${myservice}.mo ]] \
82 && TEXTDOMAIN="${myservice}"
83
84 # Source configuration files.
85 # (1) Source /etc/conf.d/net if it is a net.* service
86 # (2) Source /etc/conf.d/${SVCNAME} to get initscript-specific
87 # configuration (if it exists).
88 # (3) Source /etc/rc.conf to pick up potentially overriding
89 # configuration, if the system administrator chose to put it
90 # there (if it exists).
91 if net_service "${SVCNAME}" ; then
92 conf=$(add_suffix /etc/conf.d/net)
93 [[ -e ${conf} ]] && source "${conf}"
94 fi
95 conf=$(add_suffix "/etc/conf.d/${SVCNAME}")
96 [[ -e ${conf} ]] && source "${conf}"
97 conf=$(add_suffix /etc/rc.conf)
98 [[ -e ${conf} ]] && source "${conf}"
99
100 mylevel="${SOFTLEVEL}"
101 [[ ${SOFTLEVEL} == "${BOOTLEVEL}" \
102 || ${SOFTLEVEL} == "reboot" || ${SOFTLEVEL} == "shutdown" ]] \
103 && mylevel="${DEFAULTLEVEL}"
104
105 # Call svc_quit if we abort AND we have obtained a lock
106 service_started "${SVCNAME}"
107 svcstarted="$?"
108 service_inactive "${SVCNAME}"
109 svcinactive="$?"
110 svc_quit() {
111 eerror "ERROR: ${SVCNAME} caught an interrupt"
112 if service_inactive "${SVCNAME}" || [[ ${svcinactive} == "0" ]] ; then
113 mark_service_inactive "${SVCNAME}"
114 elif [[ ${svcstarted} == "0" ]] ; then
115 mark_service_started "${SVCNAME}"
116 else
117 mark_service_stopped "${SVCNAME}"
118 fi
119 exit 1
120 }
121
122 usage() {
123 local IFS="|"
124 myline="Usage: ${SVCNAME} { $* "
125 echo
126 eerror "${myline}}"
127 eerror " ${SVCNAME} without arguments for full help"
128 }
129
130 stop() {
131 # Return success so the symlink gets removed
132 return 0
133 }
134
135 start() {
136 eerror "ERROR: ${SVCNAME} does not have a start function."
137 # Return failure so the symlink doesn't get created
138 return 1
139 }
140
141 restart() {
142 svc_restart
143 }
144
145 status() {
146 # Dummy function
147 return 0
148 }
149
150 svc_schedule_start() {
151 local service="$1" start="$2"
152 [[ ! -d "${svcdir}/scheduled/${service}" ]] \
153 && mkdir -p "${svcdir}/scheduled/${service}"
154 [[ ! -e "${svcdir}/scheduled/${service}/${start}" ]] \
155 && ln -snf "/etc/init.d/${service}" \
156 "${svcdir}/scheduled/${service}/${start}"
157 }
158
159 svc_start_scheduled() {
160 [[ ! -d "${svcdir}/scheduled/${SVCNAME}" ]] && return
161 local x= services=
162
163 for x in $(dolisting "${svcdir}/scheduled/${SVCNAME}/") ; do
164 services="${services} ${x##*/}"
165 done
166
167 for x in ${services} ; do
168 service_stopped "${x}" && start_service "${x}"
169 rm -f "${svcdir}/scheduled/${SVCNAME}/${x}"
170 done
171
172 rmdir "${svcdir}/scheduled/${SVCNAME}"
173 }
174
175 svc_stop() {
176 local x= mydep= mydeps= retval=0
177 local -a servicelist=()
178
179 # Do not try to stop if it had already failed to do so
180 if is_runlevel_stop && service_failed "${SVCNAME}" ; then
181 return 1
182 elif service_stopped "${SVCNAME}" ; then
183 ewarn "WARNING: ${SVCNAME} has not yet been started."
184 return 0
185 fi
186 if ! mark_service_stopping "${SVCNAME}" ; then
187 eerror "ERROR: ${SVCNAME} is already stopping."
188 return 1
189 fi
190
191 # Ensure that we clean up if we abort for any reason
192 trap "svc_quit" INT QUIT TSTP
193
194 mark_service_starting "${SVCNAME}"
195 service_message "Service ${SVCNAME} stopping"
196
197 if in_runlevel "${SVCNAME}" "${BOOTLEVEL}" && \
198 [[ ${SOFTLEVEL} != "reboot" && ${SOFTLEVEL} != "shutdown" && \
199 ${SOFTLEVEL} != "single" ]] ; then
200 ewarn "WARNING: you are stopping a boot service."
201 fi
202
203 if [[ ${svcpause} != "yes" && ${RC_NO_DEPS} != "yes" ]] ; then
204 if net_service "${SVCNAME}" ; then
205 is_net_up || mydeps="net"
206 fi
207 mydeps="${mydeps} ${SVCNAME}"
208 fi
209
210 # Save the IN_BACKGROUND var as we need to clear it for stopping depends
211 local ib_save="${IN_BACKGROUND}"
212 unset IN_BACKGROUND
213
214 for mydep in ${mydeps} ; do
215 for x in $(needsme "${mydep}") ; do
216 if service_started "${x}" || service_inactive "${x}" ; then
217 stop_service "${x}"
218 fi
219 service_list=( "${service_list[@]}" "${x}" )
220 done
221 done
222
223 for x in "${service_list[@]}" ; do
224 # We need to test if the service has been marked stopped
225 # as the fifo may still be around if called by custom code
226 # such as postup from a net script.
227 service_stopped "${x}" && continue
228 wait_service "${x}"
229 if ! service_stopped "${x}" ; then
230 retval=1
231 break
232 fi
233 done
234
235 IN_BACKGROUND="${ib_save}"
236
237 if [[ ${retval} != "0" ]] ; then
238 eerror "ERROR: problems stopping dependent services."
239 eerror " ${SVCNAME} is still up."
240 else
241 # Now that deps are stopped, stop our service
242 (
243 exit() {
244 RC_QUIET_STDOUT="no"
245 eerror "DO NOT USE EXIT IN INIT.D SCRIPTS"
246 eerror "This IS a bug, please fix your broken init.d"
247 unset -f exit
248 exit "$@"
249 }
250 # Stop einfo/ebegin/eend from working as parallel messes us up
251 if [[ ${RC_PARALLEL_STARTUP} == "yes" ]] ; then
252 [[ ${RC_VERBOSE} != "yes" \
253 || -e ${svcdir}/exclusive/${SVCNAME} ]] \
254 && RC_QUIET_STDOUT="yes"
255 fi
256 stop
257 )
258 retval="$?"
259
260 # If a service has been marked inactive, exit now as something
261 # may attempt to start it again later
262 if [[ ${retval} == "0" ]] && service_inactive "${SVCNAME}" ; then
263 svcinactive=0
264 return 0
265 fi
266 fi
267
268 if [[ ${retval} != 0 ]] ; then
269 # Did we fail to stop? create symlink to stop multible attempts at
270 # runlevel change. Note this is only used at runlevel change ...
271 is_runlevel_stop && mark_service_failed "${SVCNAME}"
272
273 # If we are halting the system, do it as cleanly as possible
274 if [[ ${SOFTLEVEL} == "reboot" || ${SOFTLEVEL} == "shutdown" ]] ; then
275 mark_service_stopped "${SVCNAME}"
276 else
277 if [[ ${svcinactive} == "0" ]] ; then
278 mark_service_inactive "${SVCNAME}"
279 else
280 mark_service_started "${SVCNAME}"
281 fi
282 fi
283
284 service_message "eerror" "ERROR: ${SVCNAME} failed to stop"
285 else
286 svcstarted=1
287 if service_inactive "${SVCNAME}" ; then
288 svcinactive=0
289 else
290 mark_service_stopped "${SVCNAME}"
291 fi
292 service_message "Service ${SVCNAME} stopped"
293 fi
294
295 # Reset the trap
296 svc_trap
297
298 return "${retval}"
299 }
300
301 svc_start() {
302 local x= y= retval=0 startfail= startinactive=
303
304 # Do not try to start if i have done so already on runlevel change
305 if is_runlevel_start && service_failed "${SVCNAME}" ; then
306 return 1
307 elif service_started "${SVCNAME}" ; then
308 ewarn "WARNING: ${SVCNAME} has already been started."
309 return 0
310 elif service_inactive "${SVCNAME}" ; then
311 if [[ ${IN_BACKGROUND} != "true" ]] ; then
312 ewarn "WARNING: ${SVCNAME} has already been started."
313 return 0
314 fi
315 fi
316
317 if ! mark_service_starting "${SVCNAME}" ; then
318 if service_stopping "${SVCNAME}" ; then
319 eerror "ERROR: ${SVCNAME} is already stopping."
320 else
321 eerror "ERROR: ${SVCNAME} is already starting."
322 fi
323 return 1
324 fi
325
326 # Ensure that we clean up if we abort for any reason
327 trap "svc_quit" INT QUIT TSTP
328
329 service_message "Service ${SVCNAME} starting"
330
331 if broken "${SVCNAME}" ; then
332 eerror "ERROR: Some services needed are missing. Run"
333 eerror " './${SVCNAME} broken' for a list of those"
334 eerror " services. ${SVCNAME} was not started."
335 retval=1
336 fi
337
338 # Save the IN_BACKGROUND var as we need to clear it for starting depends
339 local ib_save="${IN_BACKGROUND}"
340 unset IN_BACKGROUND
341
342 if [[ ${retval} == "0" && ${RC_NO_DEPS} != "yes" ]] ; then
343 local startupservices="$(ineed "${SVCNAME}") $(valid_iuse "${SVCNAME}")"
344 local netservices=
345 for x in $(dolisting "/etc/runlevels/${BOOTLEVEL}/net.*") \
346 $(dolisting "/etc/runlevels/${mylevel}/net.*") ; do
347 netservices="${netservices} ${x##*/}"
348 done
349
350 # Start dependencies, if any.
351 if ! is_runlevel_start ; then
352 for x in ${startupservices} ; do
353 if [[ ${x} == "net" ]] && ! net_service "${SVCNAME}" \
354 && ! is_net_up ; then
355 for y in ${netservices} ; do
356 service_stopped "${y}" && start_service "${y}"
357 done
358 elif [[ ${x} != "net" ]] ; then
359 service_stopped "${x}" && start_service "${x}"
360 fi
361 done
362 fi
363
364 # We also wait for any services we're after to finish incase they
365 # have a "before" dep but we don't dep on them.
366 if is_runlevel_start ; then
367 startupservices="${startupservices} $(valid_iafter "${SVCNAME}")"
368 if net_service "${SVCNAME}" ; then
369 startupservices="${startupservices} $(valid_iafter "net")"
370 fi
371 fi
372
373 if [[ " ${startupservices} " == *" net "* ]] ; then
374 startupservices=" ${startupservices} "
375 startupservices="${startupservices/ net / ${netservices} }"
376 startupservices="${startupservices// net /}"
377 fi
378
379 # Wait for dependencies to finish.
380 for x in ${startupservices} ; do
381 service_started "${x}" && continue
382 wait_service "${x}"
383 if ! service_started "${x}" ; then
384 # A 'need' dependency is critical for startup
385 if ineed -t "${SVCNAME}" "${x}" >/dev/null \
386 || net_service "${x}" && ineed -t "${SVCNAME}" net \
387 && ! is_net_up ; then
388 if service_inactive "${x}" || service_wasinactive "${x}" || \
389 [[ -n $(ls "${svcdir}"/scheduled/*/"${x}" 2>/dev/null) ]] ; then
390 if svc_schedule_start "${x}" "${SVCNAME}" ; then
391 [[ -n ${startinactive} ]] && startinactive="${startinactive}, "
392 startinactive="${startinactive}${x}"
393 fi
394 else
395 startfail="${x}"
396 break
397 fi
398 fi
399 fi
400 done
401
402 if [[ -n ${startfail} ]] ; then
403 eerror "ERROR: Problem starting needed service ${startfail}"
404 eerror " ${SVCNAME} was not started."
405 retval=1
406 elif [[ -n ${startinactive} ]] ; then
407 # Change the last , to or for correct grammar.
408 x="${startinactive##*, }"
409 startinactive="${startinactive/%, ${x}/ or ${x}}"
410 ewarn "WARNING: ${SVCNAME} is scheduled to start when ${startinactive} has started."
411 retval=1
412 fi
413 fi
414
415 if [[ ${retval} == "0" ]] ; then
416 IN_BACKGROUND="${ib_save}"
417 (
418 exit() {
419 RC_QUIET_STDOUT="no"
420 eerror "DO NOT USE EXIT IN INIT.D SCRIPTS"
421 eerror "This IS a bug, please fix your broken init.d"
422 unset -f exit
423 exit "$@"
424 }
425
426 # Apply any ulimits if defined
427 [[ -n ${RC_ULIMIT} ]] && ulimit ${RC_ULIMIT}
428
429 # Stop einfo/ebegin/eend from working as parallel messes us up
430 if [[ ${RC_PARALLEL_STARTUP} == "yes" ]] ; then
431 [[ ${RC_VERBOSE} != "yes" \
432 || -e ${svcdir}/exclusive/${SVCNAME} ]] \
433 && RC_QUIET_STDOUT="yes"
434 fi
435
436 start
437 )
438 retval="$?"
439
440 # If a service has been marked inactive, exit now as something
441 # may attempt to start it again later
442 if [[ ${retval} == "0" ]] && service_inactive "${SVCNAME}" ; then
443 svcinactive=0
444 service_message "ewarn" "WARNING: ${SVCNAME} has started but is inactive"
445 return 1
446 fi
447 fi
448
449 if [[ ${retval} != "0" ]] ; then
450 if [[ ${svcinactive} == "0" ]] ; then
451 mark_service_inactive "${SVCNAME}"
452 else
453 mark_service_stopped "${SVCNAME}"
454 fi
455
456 if [[ -z ${startinactive} ]] ; then
457 is_runlevel_start && mark_service_failed "${SVCNAME}"
458 service_message "eerror" "ERROR: ${SVCNAME} failed to start"
459 fi
460 else
461 svcstarted=0
462 mark_service_started "${SVCNAME}"
463 service_message "Service ${SVCNAME} started"
464 fi
465
466 # Reset the trap
467 svc_trap
468
469 return "${retval}"
470 }
471
472 svc_restart() {
473 if ! service_stopped "${SVCNAME}" ; then
474 svc_stop || return "$?"
475 fi
476 svc_start
477 }
478
479 svc_status() {
480 # The basic idea here is to have some sort of consistent
481 # output in the status() function which scripts can use
482 # as an generic means to detect status. Any other output
483 # should thus be formatted in the custom status() function
484 # to work with the printed " * status: foo".
485 local efunc="" state=""
486
487 # If we are effectively root, check to see if required daemons are running
488 # and update our status accordingly
489 [[ ${EUID} == 0 ]] && update_service_status "${SVCNAME}"
490
491 if service_stopping "${SVCNAME}" ; then
492 efunc="eerror"
493 state="stopping"
494 elif service_starting "${SVCNAME}" ; then
495 efunc="einfo"
496 state="starting"
497 elif service_inactive "${SVCNAME}" ; then
498 efunc="ewarn"
499 state="inactive"
500 elif service_started "${SVCNAME}" ; then
501 efunc="einfo"
502 state="started"
503 else
504 efunc="eerror"
505 state="stopped"
506 fi
507 [[ ${RC_QUIET_STDOUT} != "yes" ]] \
508 && ${efunc} "status: ${state}"
509
510 status
511 # Return 0 if started, otherwise 1
512 [[ ${state} == "started" ]]
513 }
514
515 rcscript_errors=$(bash -n "${myscript}" 2>&1) || {
516 [[ -n ${rcscript_errors} ]] && echo "${rcscript_errors}" >&2
517 eerror "ERROR: ${myscript} has syntax errors in it; aborting ..."
518 exit 1
519 }
520
521 # set *after* wrap_rcscript, else we get duplicates.
522 opts="start stop restart"
523
524 source "${myscript}"
525
526 # make sure whe have valid $opts
527 if [[ -z ${opts} ]] ; then
528 opts="start stop restart"
529 fi
530
531 svc_homegrown() {
532 local x arg="$1"
533 shift
534
535 # Walk through the list of available options, looking for the
536 # requested one.
537 for x in ${opts} ; do
538 if [[ ${x} == "${arg}" ]] ; then
539 if typeset -F "${x}" &>/dev/null ; then
540 # Run the homegrown function
541 "${x}"
542
543 return $?
544 fi
545 fi
546 done
547 x=""
548
549 # If we're here, then the function wasn't in $opts.
550 [[ -n $* ]] && x="/ $* "
551 eerror "ERROR: wrong args ( "${arg}" ${x})"
552 # Do not quote this either ...
553 usage ${opts}
554 exit 1
555 }
556
557 shift
558 if [[ $# -lt 1 ]] ; then
559 eerror "ERROR: not enough args."
560 usage ${opts}
561 exit 1
562 fi
563 for arg in $* ; do
564 case "${arg}" in
565 --quiet)
566 RC_QUIET="yes"
567 RC_QUIET_STDOUT="yes"
568 ;;
569 # We check this in functions.sh ...
570 # --nocolor)
571 # RC_NOCOLOR="yes"
572 # ;;
573 --nodeps)
574 RC_NO_DEPS="yes"
575 ;;
576 --verbose)
577 RC_VERBOSE="yes"
578 ;;
579 esac
580 done
581
582 retval=0
583 for arg in $* ; do
584 case "${arg}" in
585 stop)
586 if [[ -e "${svcdir}/scheduled/${SVCNAME}" ]] ; then
587 rm -Rf "${svcdir}/scheduled/${SVCNAME}"
588 fi
589
590 # Stoped from the background - treat this as a restart so that
591 # stopped services come back up again when started.
592 if [[ ${IN_BACKGROUND} == "true" ]] ; then
593 rm -rf "${svcdir}/snapshot/$$"
594 mkdir -p "${svcdir}/snapshot/$$"
595 cp -pP "${svcdir}"/started/* "${svcdir}/snapshot/$$/"
596 rm -f "${svcdir}/snapshot/$$/${SVCNAME}"
597 fi
598
599 svc_stop
600 retval="$?"
601
602 if [[ ${IN_BACKGROUND} == "true" ]] ; then
603 for x in $(dolisting "${svcdir}/snapshot/$$/") ; do
604 if [[ -x ${x} ]] && service_stopped "${x##*/}" ; then
605 svc_schedule_start "${SVCNAME}" "${x##*/}"
606 fi
607 done
608 else
609 rm -f "${svcdir}"/scheduled/*/"${SVCNAME}"
610 fi
611
612 ;;
613 start)
614 svc_start
615 retval="$?"
616 service_started "${SVCNAME}" && svc_start_scheduled
617 ;;
618 needsme|ineed|usesme|iuse|broken)
619 trace_dependencies "-${arg}"
620 ;;
621 status)
622 svc_status
623 retval="$?"
624 ;;
625 zap)
626 einfo "Manually resetting ${SVCNAME} to stopped state."
627 mark_service_stopped "${SVCNAME}"
628 ;;
629 restart)
630 svcrestart="yes"
631
632 # We don't kill child processes if we're restarting
633 # This is especically important for sshd ....
634 RC_KILL_CHILDREN="no"
635
636 # Create a snapshot of started services
637 rm -rf "${svcdir}/snapshot/$$"
638 mkdir -p "${svcdir}/snapshot/$$"
639 cp -pP "${svcdir}"/started/* "${svcdir}/snapshot/$$/"
640 rm -f "${svcdir}/snapshot/$$/${SVCNAME}"
641
642 # Simple way to try and detect if the service use svc_{start,stop}
643 # to restart if it have a custom restart() funtion.
644 svcres=$(sed -ne '/[[:space:]]*restart[[:space:]]*()/,/}/ p' \
645 /etc/init.d/"${SVCNAME}" )
646 if [[ -n ${svcres} ]] ; then
647 if [[ ! ${svcres} =~ "svc_stop" \
648 || ! ${svcres} =~ "svc_start" ]] ; then
649 echo
650 ewarn "Please use 'svc_stop; svc_start' and not 'stop; start' to"
651 ewarn "restart the service in its custom 'restart()' function."
652 ewarn "Run ${SVCNAME} without arguments for more info."
653 echo
654 svc_restart
655 else
656 restart
657 fi
658 else
659 restart
660 fi
661 retval="$?"
662
663 [[ -e "${svcdir}/scheduled/${SVCNAME}" ]] \
664 && rm -Rf "${svcdir}/scheduled/${SVCNAME}"
665
666 # Restart dependencies as well
667 for x in $(dolisting "${svcdir}/snapshot/$$/") ; do
668 if [[ -x ${x} ]] && service_stopped "${x##*/}" ; then
669 if service_inactive "${SVCNAME}" \
670 || service_wasinactive "${SVCNAME}" ; then
671 svc_schedule_start "${SVCNAME}" "${x##*/}"
672 ewarn "WARNING: ${x##*/} is scheduled to start when ${SVCNAME} has started."
673 elif service_started "${SVCNAME}" ; then
674 start_service "${x##*/}"
675 fi
676 fi
677 done
678 rm -rf "${svcdir}/snapshot/$$"
679
680 service_started "${SVCNAME}" && svc_start_scheduled
681
682 # Wait for services to come up
683 [[ ${RC_PARALLEL_STARTUP} == "yes" ]] && wait
684
685 svcrestart="no"
686 ;;
687 pause)
688 svcpause="yes"
689 svc_stop
690 retval="$?"
691 svcpause="no"
692 ;;
693 --quiet|--nocolor|--nodeps|--verbose)
694 ;;
695 help)
696 exec "${svclib}"/sh/rc-help.sh "${myscript}" help
697 ;;
698 *)
699 # Allow for homegrown functions
700 svc_homegrown ${arg}
701 retval="$?"
702 ;;
703 esac
704 done
705
706 exit "${retval}"
707
708 # vim:ts=4

Properties

Name Value
svn:eol-style native
svn:executable *
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.20