# ntpdate error

## li1_getoo

can anyone help me fix this please 

 this is how my /etc/conf.d/ntpd looks

```
# Copyright 1999-2002 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License v2         

# $Header: /home/cvsroot/gentoo-x86/net-misc/ntp/files/ntpd.confd,v 1.8 2003/01/01 01:27:45 vapier Exp $

# Comment this out if you dont want the init script to warn

# about not having ntpdate setup

NTPDATE_WARN="y"

# Command to run to set the clock initially

# if you want to use ntpd to set the clock, change this to 'ntpd'

NTPDATE_CMD="ntpd"

# Options to pass to the above command

# you might want to change 'someserver' to a valid

# hostname which you can aquire below

NTPDATE_OPTS="-b time.nist.gov"

# A list of available servers is available here:

# * http://www.eecis.udel.edu/~mills/ntp/clock1.html

# and

# * http://www.eecis.udel.edu/~mills/ntp/clock2.html

```

in my mind the NTPDATE_O part is not correct 

thanx for ur comments

----------

## ebrostig

What is your problem btw, you never told us?  :Smile: 

The server info should go into /etc/ntp.conf and not in  /etc/conf.d/ntpd.

Here are my files:

```

/etc/conf.d/ntpd:

# Copyright 1999-2002 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License v2

# $Header: /home/cvsroot/gentoo-x86/net-misc/ntp/files/ntpd.confd,v 1.8 2003/01/01 01:27:45 vapier Exp $

# Comment this out if you dont want the init script to warn

# about not having ntpdate setup

NTPDATE_WARN="y"

# Command to run to set the clock initially

# if you want to use ntpd to set the clock, change this to 'ntpd'

#NTPDATE_CMD="ntpdate"

# Options to pass to the above command

# you might want to change 'someserver' to a valid

# hostname which you can aquire below

#NTPDATE_OPTS="-b someserver"

##

# A list of available servers is available here:

# * http://www.eecis.udel.edu/~mills/ntp/clock1.html

# and

# * http://www.eecis.udel.edu/~mills/ntp/clock2.html

##

/etc/ntp.conf:

restrict default noquery notrust nomodify

restrict 127.0.0.1

restrict 138.x.x.x mask 255.255.252.0

restrict 138.x.x.x

server 138.x.x.x

driftfile /etc/ntp.drift

logfile /var/log/ntp.log

```

I just removed my ip's since they are internal anyway and replaced them with 'x'.

Hope this helps!

Erik

----------

## li1_getoo

sorry 

```
# cat /etc/conf.d/ntpd | grep ^N

NTPDATE_WARN="y"

NTPDATE_CMD="ntpd"

NTPDATE_OPTS="-b nistl-ny.glassey.com"

```

this is my problem i cant start it right 

```
 /etc/init.d/ntpd start

 * Initializing clock via ntpd...

usage: ntpd [ -abdgmnqx ] [ -c config_file ] [ -e e_delay ]

                [ -f freq_file ] [ -k key_file ] [ -l log_file ]

                [ -p pid_file ] [ -r broad_delay ] [ -s statdir ]

                [ -t trust_key ] [ -v sys_var ] [ -V default_sysvar ]

                [ -P fixed_process_priority ]

 * Failed to run ntpd                                                     [ !! ]

 * Starting ntpd...                                                       [ ok ]
```

----------

## ebrostig

See my entry? They are commented out:

#NTPDATE_CMD="ntpdate"

#NTPDATE_OPTS="-b someserver"

-b is only an option to ntpdate, not to ntpd.

You can either change NTPDATE_CMD to ntpdate or comment it out as I have.

They are defined in /etc/ntp.conf.

Tyr to change it and use my previous post as a template.

Erik

----------

## li1_getoo

thank u

----------

## pjp

Moved from Other Things Gentoo.

----------

## pjp

 *ebrostig wrote:*   

> 
> 
> ```
> restrict 138.x.x.x mask 255.255.252.0
> 
> ...

 Could you elaborate on what each of the 138 addresses are for?  IP 138 with mask is what?  IP of restrict 138 is?  IP of server 138 is?  Are they all the same, do they point to the timeserver, or something else?  

I read the documentation, but it didn't make much sense to me.  I ended up putting only NTPDATESERVER=128.blah (local time server) into conf.d/ntp.conf

----------

## li1_getoo

k whatever changes i made stoped me from getting  errors while loading my kernel , but 

`how do u check to see if u get the accurate time ?`

```
 root # ntpdate

10 Jan 18:58:52 ntpdate[28228]: no servers can be used, exiting

```

i was getting this before all the changes 

```
root # cat /etc/conf.d/ntpd | grep [=]

NTPDATE_WARN="y"

NTPDATE_CMD="ntpd"

NTPDATE="-b nistl-ny.glassey.com"

```

----------

## ebrostig

You need to specify the server used with ntpdate:

ntpdate server-name

Oh, the restrict is set to ensure I'm only using the local sub-net. You can remove them if you want to.

Erik

----------

