rc.subr (153105) | rc.subr (153152) |
---|---|
1# $NetBSD: rc.subr,v 1.60 2003/07/26 05:13:47 lukem Exp $ | 1# $NetBSD: rc.subr,v 1.60 2003/07/26 05:13:47 lukem Exp $ |
2# $FreeBSD: head/etc/rc.subr 153105 2005-12-05 07:04:15Z dougb $ | 2# $FreeBSD: head/etc/rc.subr 153152 2005-12-06 05:27:11Z yar $ |
3# 4# Copyright (c) 1997-2002 The NetBSD Foundation, Inc. 5# All rights reserved. 6# 7# This code is derived from software contributed to The NetBSD Foundation 8# by Luke Mewburn. 9# 10# Redistribution and use in source and binary forms, with or without --- 582 unchanged lines hidden (view full) --- 593 echo "${name} is not running." 594 return 1 595 fi 596 ;; 597 598 start) 599 if [ -z "$rc_fast" -a -n "$rc_pid" ]; then 600 echo "${name} already running? (pid=$rc_pid)." | 3# 4# Copyright (c) 1997-2002 The NetBSD Foundation, Inc. 5# All rights reserved. 6# 7# This code is derived from software contributed to The NetBSD Foundation 8# by Luke Mewburn. 9# 10# Redistribution and use in source and binary forms, with or without --- 582 unchanged lines hidden (view full) --- 593 echo "${name} is not running." 594 return 1 595 fi 596 ;; 597 598 start) 599 if [ -z "$rc_fast" -a -n "$rc_pid" ]; then 600 echo "${name} already running? (pid=$rc_pid)." |
601 exit 1 | 601 return 1 |
602 fi 603 604 if [ ! -x ${_chroot}${command} ]; then 605 info "run_rc_command: cannot run ($command)." | 602 fi 603 604 if [ ! -x ${_chroot}${command} ]; then 605 info "run_rc_command: cannot run ($command)." |
606 return 0 | 606 return 1 |
607 fi 608 609 # check for required variables, 610 # directories, and files 611 # 612 for _f in $required_vars; do 613 if ! checkyesno $_f; then 614 warn "\$${_f} is not set." --- 61 unchanged lines hidden (view full) --- 676 if [ -n "${_postcmd}" ]; then 677 debug "run_rc_command: evaluating ${_postcmd}()." 678 eval $_postcmd 679 fi 680 ;; 681 682 stop) 683 if [ -z "$rc_pid" ]; then | 607 fi 608 609 # check for required variables, 610 # directories, and files 611 # 612 for _f in $required_vars; do 613 if ! checkyesno $_f; then 614 warn "\$${_f} is not set." --- 61 unchanged lines hidden (view full) --- 676 if [ -n "${_postcmd}" ]; then 677 debug "run_rc_command: evaluating ${_postcmd}()." 678 eval $_postcmd 679 fi 680 ;; 681 682 stop) 683 if [ -z "$rc_pid" ]; then |
684 [ -n "$rc_fast" ] && exit 0 | 684 [ -n "$rc_fast" ] && return 0 |
685 if [ -n "$pidfile" ]; then 686 echo \ 687 "${name} not running? (check $pidfile)." 688 else 689 echo "${name} not running?" 690 fi | 685 if [ -n "$pidfile" ]; then 686 echo \ 687 "${name} not running? (check $pidfile)." 688 else 689 echo "${name} not running?" 690 fi |
691 exit 1 | 691 return 1 |
692 fi 693 694 # if the precmd failed and force 695 # isn't set, exit 696 # 697 if [ -n "$_precmd" ]; then 698 eval $_precmd 699 _return=$? --- 28 unchanged lines hidden (view full) --- 728 reload) 729 if [ -z "$rc_pid" ]; then 730 if [ -n "$pidfile" ]; then 731 echo \ 732 "${name} not running? (check $pidfile)." 733 else 734 echo "${name} not running?" 735 fi | 692 fi 693 694 # if the precmd failed and force 695 # isn't set, exit 696 # 697 if [ -n "$_precmd" ]; then 698 eval $_precmd 699 _return=$? --- 28 unchanged lines hidden (view full) --- 728 reload) 729 if [ -z "$rc_pid" ]; then 730 if [ -n "$pidfile" ]; then 731 echo \ 732 "${name} not running? (check $pidfile)." 733 else 734 echo "${name} not running?" 735 fi |
736 exit 1 | 736 return 1 |
737 fi 738 echo "Reloading ${name} config files." 739 if [ -n "$_precmd" ]; then 740 eval $_precmd 741 _return=$? 742 [ $_return -ne 0 ] && [ -z "$rc_force" ] && 743 return 1 744 fi --- 57 unchanged lines hidden (view full) --- 802 ;; 803 804 esac 805 return $_return 806 done 807 808 echo 1>&2 "$0: unknown directive '$rc_arg'." 809 rc_usage $_keywords | 737 fi 738 echo "Reloading ${name} config files." 739 if [ -n "$_precmd" ]; then 740 eval $_precmd 741 _return=$? 742 [ $_return -ne 0 ] && [ -z "$rc_force" ] && 743 return 1 744 fi --- 57 unchanged lines hidden (view full) --- 802 ;; 803 804 esac 805 return $_return 806 done 807 808 echo 1>&2 "$0: unknown directive '$rc_arg'." 809 rc_usage $_keywords |
810 exit 1 | 810 # not reached |
811} 812 813# 814# run_rc_script file arg 815# Start the script `file' with `arg', and correctly handle the 816# return value from the script. If `file' ends with `.sh', it's 817# sourced into the current environment. If `file' appears to be 818# a backup or scratch file, ignore it. Otherwise if it's --- 578 unchanged lines hidden --- | 811} 812 813# 814# run_rc_script file arg 815# Start the script `file' with `arg', and correctly handle the 816# return value from the script. If `file' ends with `.sh', it's 817# sourced into the current environment. If `file' appears to be 818# a backup or scratch file, ignore it. Otherwise if it's --- 578 unchanged lines hidden --- |