Subject: Re: starting package with /etc/rc.d
To: Jeremy C. Reed <firstname.lastname@example.org>
From: Iain Hibbert <email@example.com>
Date: 11/25/2005 15:29:28
On Wed, 23 Nov 2005, Jeremy C. Reed wrote:
> On Wed, 23 Nov 2005, Iain Hibbert wrote:
> > -c specify a login class - I know nothing about this, and have no
> > /etc/login.conf file, is that likely to be important? (how does that work?
> > the man page seems to think it should have an argument, is that the shell
> > command?)
> Yes it is the shell command. -c with su if used after user name (nullmail)
> ends up being passed to the shell. So read the shell's man page for -c instead
> of su's man page.
> I think the reason that the -x was ignored in your earlier test was because
> the sh-bang line was never used (see run_rc_script function in /etc/rc.subr).
ok, done some more investigating..
> Maybe you need to add the -x to /etc/rc itself.
I am definitely running something, because 'Starting nullmailer' is
printed to the console and I fiddled in /etc/rc.subr and got it to print
the command it was about to execute just before it did so - below is the
/etc/rc.d/nullmailer file and it looks ok, but I had another thought about
the command_args - nullmailer-send does not have any kind of logging
function so its piped through logger - I can't find this done by any other
programs, would this be the right way to go about it?
I wonder if something is getting lost, in particular the & or | characters
on their way through variables (this sort of thing always gets me)..
though I can't see what the difference is between
# $NetBSD: nullmailer.sh,v 1.2 2005/08/20 02:20:45 schmonz Exp $
# PROVIDE: mail
# REQUIRE: LOGIN
$_rc_subr_loaded . /etc/rc.subr
command_args="2>&1 | logger -t nullmailer -p mail.info &"