rc.subr (160667) | rc.subr (160668) |
---|---|
1# $NetBSD: rc.subr,v 1.66 2006/04/01 10:05:50 he Exp $ | 1# $NetBSD: rc.subr,v 1.66 2006/04/01 10:05:50 he Exp $ |
2# $FreeBSD: head/etc/rc.subr 160667 2006-07-25 17:14:38Z yar $ | 2# $FreeBSD: head/etc/rc.subr 160668 2006-07-25 17:16:48Z yar $ |
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 --- 640 unchanged lines hidden (view full) --- 651 if [ -n "${_precmd}" ]; then 652 debug "run_rc_command: evaluating ${_precmd}()." 653 eval $_precmd 654 _return=$? 655 [ $_return -ne 0 ] && [ -z "$rc_force" ] && 656 return 1 657 fi 658 | 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 --- 640 unchanged lines hidden (view full) --- 651 if [ -n "${_precmd}" ]; then 652 debug "run_rc_command: evaluating ${_precmd}()." 653 eval $_precmd 654 _return=$? 655 [ $_return -ne 0 ] && [ -z "$rc_force" ] && 656 return 1 657 fi 658 |
659 # setup the command to run, and run it | 659 # setup the full command to run |
660 # 661 echo "Starting ${name}." 662 if [ -n "$_chroot" ]; then 663 _doit="\ 664${_nice:+nice -n $_nice }\ 665chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\ 666$_chroot $command $rc_flags $command_args" 667 else 668 _doit="\ 669${_chdir:+cd $_chdir; }\ 670${_nice:+nice -n $_nice }\ 671$command $rc_flags $command_args" 672 if [ -n "$_user" ]; then 673 _doit="su -m $_user -c 'sh -c \"$_doit\"'" 674 fi 675 fi 676 | 660 # 661 echo "Starting ${name}." 662 if [ -n "$_chroot" ]; then 663 _doit="\ 664${_nice:+nice -n $_nice }\ 665chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\ 666$_chroot $command $rc_flags $command_args" 667 else 668 _doit="\ 669${_chdir:+cd $_chdir; }\ 670${_nice:+nice -n $_nice }\ 671$command $rc_flags $command_args" 672 if [ -n "$_user" ]; then 673 _doit="su -m $_user -c 'sh -c \"$_doit\"'" 674 fi 675 fi 676 |
677 # run the full command; |
|
677 # if the cmd failed and force 678 # isn't set, exit 679 # 680 debug "run_rc_command: _doit: $_doit" 681 eval $_doit 682 _return=$? 683 [ $_return -ne 0 ] && [ -z "$rc_force" ] && return 1 684 --- 828 unchanged lines hidden --- | 678 # if the cmd failed and force 679 # isn't set, exit 680 # 681 debug "run_rc_command: _doit: $_doit" 682 eval $_doit 683 _return=$? 684 [ $_return -ne 0 ] && [ -z "$rc_force" ] && return 1 685 --- 828 unchanged lines hidden --- |