Subject: Re: /usr/pkgsrc/mail/nullmailer not starting with rc.d at boot
To: Iain Hibbert <plunky@rya-online.net>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: netbsd-users
Date: 11/25/2005 16:12:22
> I use the nullmailer package which includes a sample /etc/rc.d script
> in order to start nullmailer automatically.  The script is attached.

> This seemingly works. ie from a root shell,
> '/etc/rc.d/nullmailer start' fires it up and my mail is sent.

> However, it does not work during boot up.  [...]

> More to the point, WHY does it work from a root shell but not in the
> boot sequence?  what is missing at that point?  I doesnt seem to be
> anything inherited from my user login, I logged in as root directly
> and it starts fine.

Then it is probably something inherited from being logge din.

When I see such issues, it usually indicates issues related to not
having fds 0, 1, and 2 open, occasionally related to not having a
controlling tty.  In this case I think the former is more likely:

> I also added 'printf("Hello World\n");' as the very first line of the
> program and restarted.  Starting from a shell, Hello World makes it
> to the logfile, but starting from boot nothing happens.

This sounds to me as though fd 1 (stdout) is not open when it's started
from boot.  I *thought* all three std* fds were supposed to be open at
that point, but it sure doesn't look like it from that behaviour.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B