rc.subr (179872) | rc.subr (179946) |
---|---|
1# $NetBSD: rc.subr,v 1.67 2006/10/07 11:25:15 elad Exp $ | 1# $NetBSD: rc.subr,v 1.67 2006/10/07 11:25:15 elad Exp $ |
2# $FreeBSD: head/etc/rc.subr 179872 2008-06-19 07:06:11Z mtm $ | 2# $FreeBSD: head/etc/rc.subr 179946 2008-06-23 05:09:09Z mtm $ |
3# 4# Copyright (c) 1997-2004 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 --- 657 unchanged lines hidden (view full) --- 668 return 1 669 fi 670 671 if [ ! -x ${_chroot}${_chroot:+"/"}${command} ]; then 672 warn "run_rc_command: cannot run $command" 673 return 1 674 fi 675 | 3# 4# Copyright (c) 1997-2004 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 --- 657 unchanged lines hidden (view full) --- 668 return 1 669 fi 670 671 if [ ! -x ${_chroot}${_chroot:+"/"}${command} ]; then 672 warn "run_rc_command: cannot run $command" 673 return 1 674 fi 675 |
676 _run_rc_precmd || return 1 | 676 if ! _run_rc_precmd; then 677 warn "failed precmd routine for ${name}" 678 return 1 679 fi |
677 678 # setup the full command to run 679 # | 680 681 # setup the full command to run 682 # |
680 echo "Starting ${name}." | 683 [ -z "${rc_quiet}" ] && echo "Starting ${name}." |
681 if [ -n "$_chroot" ]; then 682 _doit="\ 683${_nice:+nice -n $_nice }\ 684chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\ 685$_chroot $command $rc_flags $command_args" 686 else 687 _doit="\ 688${_chdir:+cd $_chdir && }\ --- 6 unchanged lines hidden (view full) --- 695 _doit="sh -c \"$_doit\"" 696 fi 697 _doit="nice -n $_nice $_doit" 698 fi 699 fi 700 701 # run the full command 702 # | 684 if [ -n "$_chroot" ]; then 685 _doit="\ 686${_nice:+nice -n $_nice }\ 687chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\ 688$_chroot $command $rc_flags $command_args" 689 else 690 _doit="\ 691${_chdir:+cd $_chdir && }\ --- 6 unchanged lines hidden (view full) --- 698 _doit="sh -c \"$_doit\"" 699 fi 700 _doit="nice -n $_nice $_doit" 701 fi 702 fi 703 704 # run the full command 705 # |
703 _run_rc_doit "$_doit" || return 1 | 706 if ! _run_rc_doit "$_doit"; then 707 warn "failed to start ${name}" 708 return 1 709 fi |
704 705 # finally, run postcmd 706 # 707 _run_rc_postcmd 708 ;; 709 710 stop) 711 if [ -z "$rc_pid" ]; then --- 880 unchanged lines hidden --- | 710 711 # finally, run postcmd 712 # 713 _run_rc_postcmd 714 ;; 715 716 stop) 717 if [ -z "$rc_pid" ]; then --- 880 unchanged lines hidden --- |