Re: 5.3-BETA7: /etc/rc.d/ntpdate not using "$ntpdate_flags" from rc.conf ?

From: Ruslan Ermilov (ru_at_freebsd.org)
Date: 10/07/04

  • Next message: spam maps: "Re: 5.3-BETA7: /etc/rc.d/ntpdate not using "$ntpdate_flags" from rc.conf ?"
    Date: Thu, 7 Oct 2004 11:10:00 +0300
    To: spam maps <spamrefuse@yahoo.com>
    
    
    

    On Wed, Oct 06, 2004 at 07:18:19PM -0700, spam maps wrote:
    >
    > Hello,
    >
    > I'm puzzled by the /etc/rc.d/ntpdate script and
    > I wonder whether the script is wrong, or there
    > is lack of documentation here.
    >
    I'd say lack of reading the documentation. ;)

    This is from the rc.subr(8) manpage:

    : rc_flags Flags to start the default command with. Defaults
    : to ${name}_flags, unless overridden by the environ-
    : ment variable `flags'. This variable may be
    : changed by the argument_precmd method.

    > In /etc/rc.conf, I am using:
    > ntpdate_enable="YES"
    > ntpd_enable="YES"
    > with servers listed in /etc/ntp.conf.
    >
    > But I wonder if ntpdate instantly adjusts time
    > using the "-b" from default ntpdate_flags.
    >
    > The flags used by the /etc/rc.d/ntpdate script
    > are found in this order:
    >
    > 1. If /etc/ntp.conf exists and has servers
    > listed, then extract the servers from here.
    >
    ... and no ntpdate_hosts was specified.

    > 2. If above fails to find servers, then use
    > servers listed in /etc/rc.conf as
    > ntpdate_flags="...".
    >
    Um no. Everything specified as ntpdate_flags is *always*
    passed to ntpdate(8). I use ntpdate_flags="-b <ntp_server>".

    > 3. If all that fails, exit ntpdate without doing
    > any time/date modifications.
    >
    Only if neither of ntpdate_hosts, /etc/ntp.conf, and
    ntpdate_flags exist and set.

    > I also wonder whether the default ntpdate_flags
    > (set to "-b") has any effect at all, since it is
    > ignored in case 1.
    >
    Yes it does, and it becomes a value of ${rc_flags}.

            if [ -n "$ntpdate_hosts" -o -n "$rc_flags" ]; then
                    echo "Setting date via ntp."
                    ${ntpdate_command:-ntpdate} $rc_flags $ntpdate_hosts
            fi

    Run it like this to see the actual command that gets executed:

            sh -x /etc/rc.d/ntpdate start

    Cheers,

    -- 
    Ruslan Ermilov
    ru@FreeBSD.org
    FreeBSD committer
    
    


    • application/pgp-signature attachment: stored

  • Next message: spam maps: "Re: 5.3-BETA7: /etc/rc.d/ntpdate not using "$ntpdate_flags" from rc.conf ?"

    Relevant Pages

    • Re: CopyHere
      ... You explained why the script would continue if it was unable to copy ... The question was asking for help on a CopyHere command which was not ... documentation seems to say it should. ... 'Backup User Favorites ...
      (microsoft.public.scripting.vbscript)
    • Re: CopyHere
      ... You explained why the script would continue if it was unable to copy files, ... If the issue is simply the command being expected to create a directory ... documentation seems to say it should. ... 'Backup User Favorites ...
      (microsoft.public.scripting.vbscript)
    • Re: Where to begin?
      ... easily find things without reading the documentation. ... with printing and quitting... ... "File" should only be meaningful when given in a command, ...
      (comp.lang.lisp)
    • Re: CopyHere
      ... If the issue is simply the command being expected to create a directory ... whenever it appears that some command does not work as the documentation ... When used in a main script, without other error handling statements, it ... 'Backup User Favorites ...
      (microsoft.public.scripting.vbscript)
    • nice command
      ... I've never used the command nice. ... After reading some docs I'm getting ... For example I've script, for which I want to reduce priority (let it ... how PID and PPID will change after doing nice command? ...
      (comp.unix.programmer)