Subject: Re: pkg/32017
To: None <solaris-pkg-people@netbsd.org, gnats-admin@netbsd.org,>
From: NAKAJI Hiroyuki <nakaji@jp.freebsd.org>
List: pkgsrc-bugs
Date: 11/10/2005 03:32:02
The following reply was made to PR pkg/32017; it has been noted by GNATS.

From: NAKAJI Hiroyuki <nakaji@jp.freebsd.org>
To: "Jeremy C. Reed" <reed@reedmedia.net>
Cc: wiz@netbsd.org, solaris-pkg-people@netbsd.org,
	gnats-bugs@netbsd.org
Subject: Re: pkg/32017
Date: Thu, 10 Nov 2005 12:30:37 +0900

 Thank you for comments.
 
 In addition, rc.subr script in pkgtools/rc.subr seems not compatible with
 /bin/sh (==/sbin/sh) of Solaris 10 and later, because it is using /bin/ksh
 (or recent /bin/sh) syntax in some part but Solaris 10 executes
 /etc/rcN.d/* script with /bin/sh via /lib/svc/bin/lsvcrun.
 
 I read a source of lsvcrun in OpenSolaris and found that "/bin/sh" is
 hard-coded in it.
 http://cvs.opensolaris.org/source/xref/on/usr/src/cmd/svc/lsvcrun/lsvcrun.c
 
 I made a patch to fix this. Please test it, too.
 
 Index: rc.subr
 ===================================================================
 RCS file: /cvsroot/pkgsrc/pkgtools/rc.subr/files/rc.subr,v
 retrieving revision 1.5
 diff -u -r1.5 rc.subr
 --- rc.subr	11 Oct 2004 19:32:14 -0000	1.5
 +++ rc.subr	10 Nov 2005 03:23:30 -0000
 @@ -63,7 +63,7 @@
  _RCARG_psformat="-o pid,command"
  _RCARG_ps="-ax"
  
 -_osname=$(uname -s)
 +_osname=`uname -s`
  case $_osname in
  	SunOS)
  		_RCCMD_chown="/bin/chown"
 @@ -94,7 +94,7 @@
  		_RCCMD_chown="/bin/chown"
  #		_RCCMD_ci="/usr/bin/ci"			# not in Slackware 8.1
  #		_RCCMD_co="/usr/bin/co"			# not in Slackware 8.1
 -		_RCCMD_nice=$(which nice)
 +		_RCCMD_nice=`which nice`
  #		_RCCMD_rcs="/usr/bin/rcs"		# not in Slackware 8.1
  #		_RCCMD_systrace="/bin/systrace"		# not in Slackware 8.1
  		_RCARG_ps="ax"
 @@ -137,7 +137,7 @@
  reverse_list()
  {
  	_revlist=
 -	for _revfile; do
 +	for _revfile in $*; do
  		_revlist="$_revfile $_revlist"
  	done
  	${_RCCMD_echo} $_revlist
 @@ -474,9 +474,9 @@
  					# setup pid check command if not fast
  	if [ -z "$rc_fast" -a -n "$_procname" ]; then
  		if [ -n "$pidfile" ]; then
 -			_pidcmd='rc_pid=$(check_pidfile '"$pidfile $_procname $command_interpreter"')'
 +			_pidcmd='rc_pid=`check_pidfile '"$pidfile $_procname $command_interpreter"'`'
  		else
 -			_pidcmd='rc_pid=$(check_process '"$_procname $command_interpreter"')'
 +			_pidcmd='rc_pid=`check_process '"$_procname $command_interpreter"'`'
  		fi
  		if [ -n "$_pidcmd" ]; then
  			_keywords="${_keywords} status poll"
 @@ -498,7 +498,7 @@
  	    _systrace=\$${name}_systrace
  
  	if [ -n "$_user" ]; then	# unset $_user if running as that user
 -		if [ "$_user" = "$($_RCCMD_whoami)" ]; then
 +		if [ "$_user" = "`$_RCCMD_whoami`" ]; then
  			unset _user
  		fi
  	fi
 @@ -830,7 +830,7 @@
  	${_RCCMD_echo} -n 1>&2 "Usage: $0 [fast|force]("
  
  	_sep=
 -	for _elem; do
 +	for _elem in $*; do
  		${_RCCMD_echo} -n 1>&2 "$_sep$_elem"
  		_sep="|"
  	done
 
 -- 
 NAKAJI Hiroyuki