| … | |
… | |
| 86 | local retval=0 |
86 | local retval=0 |
| 87 | local ordservice="" |
87 | local ordservice="" |
| 88 | |
88 | |
| 89 | if [ ! -L "${svcdir}/started/${myservice}" ] |
89 | if [ ! -L "${svcdir}/started/${myservice}" ] |
| 90 | then |
90 | then |
|
|
91 | if [ "${RC_QUIET_STDOUT}" != "yes" ] |
|
|
92 | then |
| 91 | eerror "ERROR: \"${myservice}\" has not yet been started." |
93 | eerror "ERROR: \"${myservice}\" has not yet been started." |
| 92 | return 1 |
94 | return 1 |
|
|
95 | else |
|
|
96 | return 0 |
|
|
97 | fi |
| 93 | fi |
98 | fi |
| 94 | |
99 | |
| 95 | # Do not try to stop if it had already failed to do so on runlevel change |
100 | # Do not try to stop if it had already failed to do so on runlevel change |
| 96 | if [ -L "${svcdir}/failed/${myservice}" -a -d "${svcdir}/softscripts.new" ] |
101 | if [ -L "${svcdir}/failed/${myservice}" -a -d "${svcdir}/softscripts.new" ] |
| 97 | then |
102 | then |
| … | |
… | |
| 316 | then |
321 | then |
| 317 | rm -f "${svcdir}/started/${myservice}" |
322 | rm -f "${svcdir}/started/${myservice}" |
| 318 | fi |
323 | fi |
| 319 | return "${retval}" |
324 | return "${retval}" |
| 320 | else |
325 | else |
|
|
326 | if [ "${RC_QUIET_STDOUT}" != "yes" ] |
|
|
327 | then |
| 321 | ewarn "WARNING: \"${myservice}\" has already been started." |
328 | ewarn "WARNING: \"${myservice}\" has already been started." |
|
|
329 | fi |
|
|
330 | |
| 322 | return 0 |
331 | return 0 |
| 323 | fi |
332 | fi |
| 324 | } |
333 | } |
| 325 | |
334 | |
| 326 | svc_restart() { |
335 | svc_restart() { |
| … | |
… | |
| 340 | # should thus be formatted in the custom status() function |
349 | # should thus be formatted in the custom status() function |
| 341 | # to work with the printed " * status: foo". |
350 | # to work with the printed " * status: foo". |
| 342 | |
351 | |
| 343 | if [ -L "${svcdir}/started/${myservice}" ] |
352 | if [ -L "${svcdir}/started/${myservice}" ] |
| 344 | then |
353 | then |
|
|
354 | if [ "${RC_QUIET_STDOUT}" != "yes" ] |
|
|
355 | then |
| 345 | einfo "status: started" |
356 | einfo "status: started" |
|
|
357 | else |
|
|
358 | return 0 |
|
|
359 | fi |
| 346 | else |
360 | else |
|
|
361 | if [ "${RC_QUIET_STDOUT}" != "yes" ] |
|
|
362 | then |
| 347 | eerror "status: stopped" |
363 | eerror "status: stopped" |
|
|
364 | else |
|
|
365 | return 1 |
|
|
366 | fi |
| 348 | fi |
367 | fi |
| 349 | |
368 | |
| 350 | status |
369 | status |
| 351 | } |
370 | } |
| 352 | |
371 | |
| … | |
… | |
| 579 | fi |
598 | fi |
| 580 | for arg in $* |
599 | for arg in $* |
| 581 | do |
600 | do |
| 582 | case "${arg}" in |
601 | case "${arg}" in |
| 583 | --quiet) |
602 | --quiet) |
| 584 | QUIET_STDOUT="yes" |
603 | RC_QUIET_STDOUT="yes" |
|
|
604 | ;; |
|
|
605 | # We check this in functions.sh ... |
|
|
606 | # --nocolor) |
|
|
607 | # RC_NOCOLOR="yes" |
| 585 | ;; |
608 | # ;; |
| 586 | esac |
609 | esac |
| 587 | done |
610 | done |
| 588 | for arg in $* |
611 | for arg in $* |
| 589 | do |
612 | do |
| 590 | case "${arg}" in |
613 | case "${arg}" in |
| … | |
… | |
| 650 | pause) |
673 | pause) |
| 651 | svcpause="yes" |
674 | svcpause="yes" |
| 652 | svc_stop |
675 | svc_stop |
| 653 | svcpause="no" |
676 | svcpause="no" |
| 654 | ;; |
677 | ;; |
| 655 | --quiet) |
678 | --quiet|--nocolor) |
| 656 | ;; |
679 | ;; |
| 657 | *) |
680 | *) |
| 658 | # Allow for homegrown functions |
681 | # Allow for homegrown functions |
| 659 | svc_homegrown ${arg} |
682 | svc_homegrown ${arg} |
| 660 | ;; |
683 | ;; |