Re: tail, tr: not found when booting

From: Brooks Davis <brooks_at_one-eyed-alien.net>
Date: Wed, 12 Apr 2006 10:46:30 -0700
On Wed, Apr 12, 2006 at 04:33:09PM +0100, Florent Thoumie wrote:
> On Wed, 2006-04-12 at 08:18 -0700, Brooks Davis wrote:
> > On Wed, Apr 12, 2006 at 10:41:36AM -0400, John Baldwin wrote:
> > > On Tuesday 11 April 2006 23:27, Rong-En Fan wrote:
> > > > Hi,
> > > > 
> > > > I just upgraded my -currnet to today. I noticed that rc complains about
> > > > tail and tr not found:
> > > > 
> > > > [...]
> > > > Trying to mount root from ufs:/dev/ad0s3a
> > > > start_init: trying /sbin/init
> > > > tail: not found
> > > > tr: not found
> > > > Loading configuration files.
> > > > kernel dumps on /dev/ad0s3b
> > > > [...]
> > > > 
> > > > The following line in rc.subr looks suspicious
> > > > 
> > > > JID=`ps -p $$ -o jid | tail -1 | tr -d ' '`
> > > > 
> > > > They should be replaced by absolute name as the rest command in
> > > > rc.subr. :-)
> > > 
> > > You don't have tail and tr in /usr/bin?  Hmm, I wonder if /usr is
> > > mounted at that point, if not then rc.subr needs to be fixed.
> > 
> > You can't do anything with /usr this early.  This needs to be
> > moved to _find_processes() where it's actually used.  I suspect it
> > should also be converted to pure shell code.  I think this would work:
> > 
> > for ent in `ps -p $$ -o jid`; do
> > 	JID=$ent 
> > done
> 
> Oops, indeed. I've been over-confident thinking tr/tail were in /, and
> testing stop/start obviously didn't help.
> 
> I can't think of another way to do this.

I've checked (at least as much as I can without an actual jail around)
and the above appears to set JID correctly.

-- Brooks

-- 
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4

Received on Wed Apr 12 2006 - 15:46:36 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:54 UTC