Modify

Opened 11 years ago

Closed 11 years ago

#1835 closed defect (fixed)

NTPClient hotplug script fix

Reported by: Ricadelic@… Owned by: developers
Priority: normal Milestone:
Component: packages Version:
Keywords: NTPClient Hotplug.d Cc:

Description

Please change the NTPCient to the following: (made changed lines bold.)

<snip>

config_get hostname $cfg hostname

config_get port $cfg port

config_get count $cfg count

ps x | grep 'bin/[n]tpclient' >&-
{

route -n 2>&- | grep '0.0.0.0' >&- && {

/usr/sbin/ntpclient -c $count -s -h $hostname -p ${port:-123} 2>&- >&-

}

}

;;

<snip>

Attachments (0)

Change History (2)

comment:1 Changed 11 years ago by Carlos Sobrinho <epilog@…>

Also, there is a problem when multiple servers are specified.

I forgot to add this patch in my original post of the config file.

Please use this patch:

--- net/ntpclient/files/ntpclient.init          2007-06-13 23:29:11.000000000 +0100
+++ net/ntpclient/files/ntpclient.init.mine     2007-06-13 23:29:11.000000000 +0100
@@ -3,6 +3,7 @@

 . /etc/functions.sh

+DONE=0
 config_cb() {
        local cfg="$CONFIG_SECTION"
        local cfgtype
@@ -13,9 +14,10 @@
                        config_get hostname     $cfg hostname
                        config_get port         $cfg port
                        config_get count        $cfg count

+                       [ "$DONE" = "1" ] && exit 0
                        ps x | grep 'bin/[n]tpclient' >&- || {
                                route -n 2>&- | grep '^0.0.0.0' >&- && {
-                                       /usr/sbin/ntpclient -h $hostname -p ${port:-123} 2>&- >&-
+                                       /usr/sbin/ntpclient -c ${count:-1} -s -h $hostname -p ${port:-123} 2>&- >&- && DONE=1
                                }
                        }
                ;;

comment:2 Changed 11 years ago by thepeople

  • Resolution set to fixed
  • Status changed from new to closed

fixed [7763]

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.