Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Jun 2008 17:01:49 -0500
From:      Derek Ragona <derek@computinginnovations.com>
To:        "David Allen" <the.real.david.allen@gmail.com>, freebsd-questions@freebsd.org
Subject:   Re: rc scripts
Message-ID:  <6.0.0.22.2.20080627165741.025edf40@mail.computinginnovations.com>
In-Reply-To: <2daa8b4e0806271411p709ad002o3137c7eb4ff53bac@mail.gmail.co m>
References:  <2daa8b4e0806271411p709ad002o3137c7eb4ff53bac@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
At 04:11 PM 6/27/2008, David Allen wrote:
>I need to an '-s' flag to the execution of openntpd's rc script:
>
>    # PROVIDE: openntpd
>    # REQUIRE: DAEMON
>    # BEFORE:  LOGIN
>    # KEYWORD: nojail
>
>    . /etc/rc.subr
>
>    name=openntpd
>    rcvar=`set_rcvar`
>    command=/usr/local/sbin/ntpd
>    required_files=/usr/local/etc/ntpd.conf
>    openntpd_enable=${openntpd_enable:-"NO"}
>    load_rc_config $name
>    run_rc_command "$1"
>
>The problems I'm having are multiple.  First, the program doesn't offer
>any logging, and running it with the "do not daemonize" switch with
>
>    # /usr/local/sbin/ntpd -d 2>&1 > logfile
>
>yields no output.
>
>Then, I'm not sure I understand everything I'm reading in rc.subr(8), but
>from trial error, I've discovered that modifying the script's "command"
>variable doesn't work, nor does adding the usual "scriptname_flags"
>directive to /etc/rc.conf.
>
>Comments, questions and complaints all welcomed.

Add:
set -x

at the top of the script and run the output to a file as you were doing.  I 
would add a path to the logfile though and don't worry about the daemon like:

/usr/local/sbin/ntpd start 2>&1 >/tmp/logfile

Then you can kill it off and see what the startup looked like in the logfile.

         -Derek


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6.0.0.22.2.20080627165741.025edf40>