Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/etc PR/42642: Ed Ravin: Handle daemons that start with #!/us...
details: https://anonhg.NetBSD.org/src/rev/6613c8c88b79
branches: trunk
changeset: 765901:6613c8c88b79
user: christos <christos%NetBSD.org@localhost>
date: Thu Jun 09 14:52:01 2011 +0000
description:
PR/42642: Ed Ravin: Handle daemons that start with #!/usr/bin/env interp
diffstat:
etc/rc.subr | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diffs (28 lines):
diff -r 7baae0b6268d -r 6613c8c88b79 etc/rc.subr
--- a/etc/rc.subr Thu Jun 09 14:47:42 2011 +0000
+++ b/etc/rc.subr Thu Jun 09 14:52:01 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: rc.subr,v 1.86 2010/09/26 18:37:14 apb Exp $
+# $NetBSD: rc.subr,v 1.87 2011/06/09 14:52:01 christos Exp $
#
# Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -248,10 +248,17 @@
read _interp < ${_chroot:-}/$_procname # read interpreter name
_interp=${_interp#\#!} # strip #!
set -- $_interp
+ if [ $1 = "/usr/bin/env" ]; then
+ shift
+ set -- $(type $1)
+ shift $(($# - 1))
+ _interp="${1##*/} $_procname"
+ else
+ _interp="$* $_procname"
+ fi
if [ $_interpreter != $1 ]; then
warn "\$command_interpreter $_interpreter != $1"
fi
- _interp="$* $_procname" # cleanup spaces, add _procname
_interpbn=${1##*/}
_fp_args='_argv'
_fp_match='case "$_argv" in
Home |
Main Index |
Thread Index |
Old Index