rc.subr (169668) | rc.subr (170282) |
---|---|
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 169668 2007-05-18 12:04:41Z mtm $ | 2# $FreeBSD: head/etc/rc.subr 170282 2007-06-04 11:39:35Z 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 --- 267 unchanged lines hidden (view full) --- 278 err 3 'USAGE: _find_processes procname interpreter psargs' 279 fi 280 _procname=$1 281 _interpreter=$2 282 _psargs=$3 283 284 _pref= 285 if [ $_interpreter != "." ]; then # an interpreted script | 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 --- 267 unchanged lines hidden (view full) --- 278 err 3 'USAGE: _find_processes procname interpreter psargs' 279 fi 280 _procname=$1 281 _interpreter=$2 282 _psargs=$3 283 284 _pref= 285 if [ $_interpreter != "." ]; then # an interpreted script |
286 # read interpreter name 287 read _interp < ${_chroot}${_chroot:+"/"}$_procname 288 _interp=${_interp#\#!} # strip #! 289 set -- $_interp 290 case $1 in 291 */bin/env) 292 shift # drop env to get real name 293 ;; 294 esac 295 if [ $_interpreter != $1 ]; then 296 warn "\$command_interpreter $_interpreter != $1" | 286 _script=${_chroot}${_chroot:+"/"}$_procname 287 if [ -r $_script ]; then 288 read _interp < $_script # read interpreter name 289 case "$_interp" in 290 \#!*) 291 _interp=${_interp#\#!} # strip #! 292 set -- $_interp 293 case $1 in 294 */bin/env) 295 shift # drop env to get real name 296 ;; 297 esac 298 if [ $_interpreter != $1 ]; then 299 warn "\$command_interpreter $_interpreter != $1" 300 fi 301 ;; 302 *) 303 warn "no shebang line in $_script" 304 set -- $_interpreter 305 ;; 306 esac 307 else 308 warn "cannot read shebang line from $_script" 309 set -- $_interpreter |
297 fi 298 _interp="$* $_procname" # cleanup spaces, add _procname 299 _interpbn=${1##*/} 300 _fp_args='_argv' 301 _fp_match='case "$_argv" in 302 ${_interp}|"${_interp} "*|"${_interpbn}: ${_procname}"*)' 303 else # a normal daemon 304 _procnamebn=${_procname##*/} --- 1267 unchanged lines hidden --- | 310 fi 311 _interp="$* $_procname" # cleanup spaces, add _procname 312 _interpbn=${1##*/} 313 _fp_args='_argv' 314 _fp_match='case "$_argv" in 315 ${_interp}|"${_interp} "*|"${_interpbn}: ${_procname}"*)' 316 else # a normal daemon 317 _procnamebn=${_procname##*/} --- 1267 unchanged lines hidden --- |