--- rc.subr.orig 2008-10-28 10:01:04.000000000 +0100 +++ rc.subr 2008-10-28 09:56:20.000000000 +0100 @@ -438,6 +438,8 @@ # to run the chrooted ${command} with. # Requires /usr to be mounted. # +# ${name}_suopt n Command parameter for 'su'. Default is '-m'. +# # ${rc_arg}_cmd n If set, use this as the method when invoked; # Otherwise, use default command (see below) # @@ -595,7 +597,8 @@ fi eval _chdir=\$${name}_chdir _chroot=\$${name}_chroot \ _nice=\$${name}_nice _user=\$${name}_user \ - _group=\$${name}_group _groups=\$${name}_groups + _group=\$${name}_group _groups=\$${name}_groups \ + _suopt=\$${name}_suopt if [ -n "$_user" ]; then # unset $_user if running as that user if [ "$_user" = "$(eval $IDCMD)" ]; then @@ -603,6 +606,10 @@ fi fi + if [ -z "$_suopt" ]; then # set default value + _suopt="-m" + fi + # if ${rcvar} is set, and $1 is not # "rcvar", then run # checkyesno ${rcvar} @@ -673,7 +680,7 @@ ${_chdir:+cd $_chdir && }\ $command $rc_flags $command_args" if [ -n "$_user" ]; then - _doit="su -m $_user -c 'sh -c \"$_doit\"'" + _doit="su $_suopt $_user -c 'sh -c \"$_doit\"'" fi if [ -n "$_nice" ]; then if [ -z "$_user" ]; then @@ -852,7 +859,7 @@ _cmd="kill -$1 $rc_pid" if [ -n "$_user" ]; then - _cmd="su -m ${_user} -c 'sh -c \"${_cmd}\"'" + _cmd="su ${_suopt} ${_user} -c 'sh -c \"${_cmd}\"'" fi echo "$_cmd" }