NetBSD Problem Report #32017
From www@netbsd.org Tue Nov 8 10:36:29 2005
Return-Path: <www@netbsd.org>
Received: by narn.netbsd.org (Postfix, from userid 31301)
id 0325963B938; Tue, 8 Nov 2005 10:36:29 +0000 (UTC)
Message-Id: <20051108103629.0325963B938@narn.netbsd.org>
Date: Tue, 8 Nov 2005 10:36:29 +0000 (UTC)
From: nakaji@jp.freebsd.org
Reply-To: nakaji@jp.freebsd.org
To: gnats-bugs@netbsd.org
Subject: pkgtools/rc.subr/files/rc.d/SERVERS gets error on Solaris 10
X-Send-Pr-Version: www-1.0
>Number: 32017
>Category: pkg
>Synopsis: pkgtools/rc.subr/files/rc.d/SERVERS gets error on Solaris 10
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: solaris-pkg-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Tue Nov 08 10:37:00 +0000 2005
>Last-Modified: Sat Feb 15 14:17:02 +0000 2020
>Originator: NAKAJI Hiroyuki
>Release: Solaris 10 x86
>Organization:
>Environment:
SunOS deepsea.c3922.takamatsu-nct.ac.jp 5.10 Generic i86pc i386 i86pc
>Description:
I installed pkgtools/rc.subr and pkgtools/rcorder in order to use rc.d scripts on my SOlaris 10. I made a startup script as /etc/init.d/local.
When I ran this "local" script, I got an error:
<unset_progname>: requirement `mountcritremote' in file `/etc/rc.d/SERVERS' has no providers.
My "local" script is like this:
#!/bin/ksh
if [ ! -f /etc/rc.subr -o ! -x /usr/pkg/sbin/rcorder -o ! -f /etc/rc.conf ]; then
exit 1
fi
. /etc/rc.subr
. /etc/rc.conf
_rc_conf_loaded=true
if ! checkyesno rc_configured; then
exit 1
fi
case "$1" in
"start")
files=`/usr/pkg/sbin/rcorder -s nostart ${rc_rcorder_flags} /etc/rc.d/*`
for _rc_elem in $files; do
run_rc_script $_rc_elem start
done
;;
"stop")
files=`/usr/pkg/sbin/rcorder -k nostart ${rc_rcorder_flags} /etc/rc.d/*`
for _rc_elem in `reverse_list $files`; do
run_rc_script $_rc_elem stop
done
;;
*)
echo "Usage: $0 { start | stop }"
exit 1
;;
esac
exit 0
>How-To-Repeat:
>Fix:
Here is a diff for pkgtools/rc.subr/files/rc.d/SERVERS.
Index: rc.d/SERVERS
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/rc.subr/files/rc.d/SERVERS,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 SERVERS
--- rc.d/SERVERS 19 Jun 2003 16:07:12 -0000 1.1.1.1
+++ rc.d/SERVERS 8 Nov 2005 10:03:45 -0000
@@ -4,7 +4,6 @@
#
# PROVIDE: SERVERS
-# REQUIRE: mountcritremote
# This is a dummy dependency, for early-start servers relying on
# some basic configuration.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: pkg-manager->solaris-pkg-people
Responsible-Changed-By: wiz@netbsd.org
Responsible-Changed-When: Tue, 08 Nov 2005 20:59:21 +0000
Responsible-Changed-Why:
Solaris pkgsrc problem.
From: "Jeremy C. Reed" <reed@reedmedia.net>
To: wiz@netbsd.org
Cc: solaris-pkg-people@netbsd.org, gnats-bugs@netbsd.org,
nakaji@jp.freebsd.org
Subject: Re: pkg/32017
Date: Tue, 8 Nov 2005 13:06:57 -0800 (PST)
On Tue, 8 Nov 2005 wiz@netbsd.org wrote:
> Synopsis: pkgtools/rc.subr/files/rc.d/SERVERS gets error on Solaris 10
>
> Responsible-Changed-From-To: pkg-manager->solaris-pkg-people
> Responsible-Changed-By: wiz@netbsd.org
> Responsible-Changed-When: Tue, 08 Nov 2005 20:59:21 +0000
> Responsible-Changed-Why:
> Solaris pkgsrc problem.
This problem is anywhere that doesn't provide a "mountcritremote" rc.d
script. (I never noticed myself, because I added a mountcritremote rc.d
script on my Linux systems.)
Is this a error that causes a failure? It should just be a warning.
Jeremy C. Reed
technical support & remote administration
http://www.pugetsoundtechnology.com/
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: Wed, 09 Nov 2005 07:41:27 +0900
> > Synopsis: pkgtools/rc.subr/files/rc.d/SERVERS gets error on Solaris 10
> >
> > Responsible-Changed-From-To: pkg-manager->solaris-pkg-people
> > Responsible-Changed-By: wiz@netbsd.org
> > Responsible-Changed-When: Tue, 08 Nov 2005 20:59:21 +0000
> > Responsible-Changed-Why:
> > Solaris pkgsrc problem.
> This problem is anywhere that doesn't provide a "mountcritremote" rc.d
> script. (I never noticed myself, because I added a mountcritremote
> rc.d script on my Linux systems.)
> Is this a error that causes a failure? It should just be a warning.
I'm not sure. But warning is surprizing.
If it is not an error, I want to change "error" in PR synopsis to
"message".
--
NAKAJI Hiroyuki
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
From: Jonathan Perkin <jonathan@perkin.org.uk>
To: NAKAJI Hiroyuki <nakaji@jp.freebsd.org>
Cc: "Jeremy C. Reed" <reed@reedmedia.net>, wiz@netbsd.org,
solaris-pkg-people@netbsd.org, gnats-bugs@netbsd.org
Subject: Re: pkg/32017
Date: Thu, 10 Nov 2005 10:52:09 +0000
* On 2005-11-10 at 03:31 GMT, NAKAJI Hiroyuki wrote:
> 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.
..and via /sbin/rc2 on older Solaris.
> I made a patch to fix this. Please test it, too.
I'd much rather we simply installed rc.d stuff on Solaris under
${LOCALBASE}/etc/rc.d, which would solve all these issues. When I
started work on a similar patch to yours, I seem to remember an awful
lot more stuff needed patching.
--
Jonathan Perkin The NetBSD Project
http://www.perkin.org.uk/ http://www.netbsd.org/
Responsible-Changed-From-To: solaris-pkg-people->sbd
Responsible-Changed-By: sbd@NetBSD.org
Responsible-Changed-When: Wed, 24 Mar 2010 20:29:10 +0000
Responsible-Changed-Why:
Over to maintainer.
Responsible-Changed-From-To: sbd->pkg-manager
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Sun, 26 Jun 2016 04:34:32 +0000
Responsible-Changed-Why:
sbd resigned and shouldn't own PRs
Responsible-Changed-From-To: pkg-manager->solaris-pkg-people
Responsible-Changed-By: rillig@NetBSD.org
Responsible-Changed-When: Sat, 15 Feb 2020 14:17:02 +0000
Responsible-Changed-Why:
It's a Solaris issue.
>Unformatted:
(Contact us)
$NetBSD: gnats-precook-prs,v 1.4 2018/12/21 14:20:20 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.