Al,

indeed there was a problem at least in the scanFile function, which I think
I corrected.  You find the modified version of that function here.
As I wrote before, there is work to be done in init about the information in
the utmp file.  it is not urgent to me, so I didn't look at it with too much
attention.
One more problem I saw is in the invocation of scripts using /bin/sh.  it seems
as if no parameters are ever passed to the script.  is there some hidden trick?

>>>init.c<<<
void scanFile(foo)
void foo();
{
  int f, left;
  char buf[BUFSIZE], *line, *next;

  f = open(INITTAB, O_RDONLY);
  if(-1 == f)
    PANIC0;

  left = read(f, buf, BUFSIZE);
  line = buf;
  next = strchr(line, '\n');
  if (next) *(next++)='\000';

  while (left>0)
  {
    if (!next)
    {
      if(line == buf)
        return;
      memmove(buf, line, left);
      left += read(f, buf+left, BUFSIZE-left);
      line = buf;
      next = strchr(line, '\n');
      if (next)
        *(next++)='\000';
    }
    else
    {
      if(isalnum(line[0]))
        parseLine(line, foo);

      left -= next-line;
      line = next;
      next = strchr(line, '\n');
      if (next > line+left)
        next = 0;
      if (next)
        *(next++)='\000';
    }
  }
  close(f);
}

>>>etc/inittab<<<
id:3:initdefault:

si::sysinit:/etc/rc.d/rc.sysinit

l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l6:6:wait:/etc/rc.d/rc 6

ud::off:/bin/update

1:2345:respawn:/bin/getty /dev/tty1
2:2345:respawn:/bin/getty /dev/tty2
3:2345:respawn:/bin/getty /dev/tty3

>>>etc/rc.d/rc.sysinit<<<
#!/bin/sh
echo doing system initialization
date -c 1999-11-30

>>>etc/rc.d/rc<<<
#!/bin/sh
echo entering runlevel $1
mount /dev/fd1 /home



Reply via email to