[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Odd ssh problem


  I've run into a very odd problem that is making me tear my hair
  out.  I've got a stripped down OpenBSD 2.5 (current as of 2 weeks
  ago) that I'm using for a firewall system.  It boots a ramdisk
  off a cd, then mounts the cd as /usr/local to hold those larger
  items like sshd and such that wouldn't fit in the ramdisk.  The
  strange thing is, when I boot the system, rc.local starts up
  sshd, and sshd immediately dies.  If i log into the console 2
  seconds later and try and start up sshd, it works fine.
  Occasionally, it gives a "Received signal 1" errori before it
  dies, but not always.  I've tried running it with nohup to no
  avail, it exited with the same error.  I've also tried running
  it in debug mode, but it provides no useful information, sometimes
  printing nothing, sometimes printing out the first line with the
  sshd version and then dying.  I'm at a complete loss as to what
  the problem may be, as the difference in system state between
  stuff run out of rc.local and stuff run from the console a few
  seconds later should not be terribly different.

  I managed to fit ktrace and friends on the cd, and came up with the 
  following (relevent secions only)

  Here is where it fails on boot, right after the initial child is forked

 23562 sshd     CALL  fork
 23562 sshd     RET   fork 12394/0x306a
 23562 sshd     CALL  exit(0)
 12394 sshd     PSIG  SIGHUP caught handler=0x20000 mask=0x0 code=0x0
 12394 sshd     RET   fork 0
 12394 sshd     CALL  write(0x2,0xefbfd530,0x14)
 12394 sshd     RET   write -1 errno 5 Input/output error
 12394 sshd     CALL  exit(0xff)

  And here's the same section when i start it from the console a few seconds 

 29055 sshd     CALL  fork
 29055 sshd     RET   fork 5597/0x15dd
 29055 sshd     CALL  exit(0)
  5597 sshd     RET   fork 0
  5597 sshd     CALL  setsid
  5597 sshd     RET   setsid 5597/0x15dd
  5597 sshd     CALL  chdir(0x30d68)
  5597 sshd     NAMI  "/"

  I've tried trapping hups in rc.local but its made no difference, it still
  dies with the same error.  Any ideas?

  My hair thanks you.