[BusyBox] ash running /etc/profile when started from inittab, take II

rich_wilson at agilent.com rich_wilson at agilent.com
Mon Jul 22 12:17:03 UTC 2002


Any attempt I make to run something called "-/bin/sh" from inittab seems doomed to failure.
Am I missing something?
My current try is 
  ::respawn:-/bin/sh </dev/ttyS0 >/dev/ttyS0 2>/dev/ttyS0
which just prints "ex" every second or so.  The serial console
isn't too useful in this state!

It occurs to me that I haven't yet solved the problem of how to get telnet to
run ash so that it reads /etc/profile.  I assume I'm going to have to hack
telnetd (actually, utelnetd) source so that it does the '-sc ". /etc/profile"' thing?
Or sticks the "-" in argv[0]?

Rich

Rich Wilson
Agilent Technologies
425-335-2245
rich_wilson at agilent.com

> -----Original Message-----
> From: Robert Griebl [mailto:griebl at gmx.de]
> Sent: Monday, July 22, 2002 8:52 AM
> To: busybox at busybox.net
> Subject: Re: [BusyBox] ash running /etc/profile when started from
> inittab, take II
> 
> 
> On Monday 22 July 2002 17:43, Vladimir N. Oleynik wrote:
> > Rich,
> >
> > > Sometimes it seems that the simpler the command, the more 
> difficult
> > > it is to get it right.
> > >
> > > Here's my second try at getting /etc/profile to run at ash startup
> > >
> > > when ash is started from inittab:
> > > ::respawn:/bin/sh -sc ". /etc/profile" </dev/ttyS0 >/dev/ttyS0
> > > :: 2>/dev/ttyS0
> > >
> > > (I added the "." command so that the settings in 
> /etc/profile would
> > > remain in effect after the script finished)
> >
> > ;)
> > Busybox init have special mode for equivalent your example
> > ttyS0::askfirst:-/bin/sh
> > But I not right.
> > sh calling with "-sh" by login util.
> >
> 
> As vodz said: when called from init use the "-sh" or 
> "-/bin/sh" notation -- 
> when called from the command line, use "ash --login"
> 
> cu
> Robert
> 
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://busybox.net/mailman/listinfo/busybox
> 



More information about the busybox mailing list