# ntpdate wont work

## bubuk

Hello omniscient!

I cant do a ntpdate anymore and i dont find the switch to cure this problem...

So, if anyone knows - i do not.

And it goes like this:

klausdieter root # ntpdate ntp1.ptb.de

Looking for host ntp1.ptb.de and service ntp

host found : ntp1.ptb.de

 3 Apr 13:31:34 ntpdate[2379]: setsockopt() IPV6_V6ONLY failed: Protocol not available

Thanks for your help!

----------

## creche

try specifing ipv4 address.

----------

## bubuk

doesn't work either, but thanks

----------

## Paul9196

I'm getting the same problem now on one of my boxes.  Anyone know why it is doing this?

Thanks,

Paul

----------

## solszew

What do the logs say?  /var/log/messages or /var/log/syslog might give you more info.

----------

## Paul9196

/var/log/everything/current shows the same thing.

----------

## woinnie

i got the same error, and can't find the switch to tell ntpdate not to use IPV6...

if one of you get the solution... thanks !

----------

## bubuk

i fixed it by installing a new kernel (2.6 ), but i dont know what the problem was...

----------

## lduperval

I'm getting the same problem. I checked the logs and the last time it worked was on April 15. On that same day, I did an emerge world and it installed ntp-4.2.0. Since then, my system hasn't worked.

When I did my update, I also upgraded portage. On a whim, I decided to add -ipv6 to my USE flags. I'm currently emerging ntp... It's done, I'm trying it and...

.

.

.

.

.

.

.

.

.

.

It doesn't work.

I'm about to log it as a bug. Unless someone has an idea what the problem is.

----------

## Deebster

After you installed a new version of ntp, it probably pointed you at https://bugs.gentoo.org/show_bug.cgi?id=41827

In a nutshell, remove 'notrust' from the4 restrict settings in /etc/ntp.conf

----------

## devnullsp

I  emerge /usr/portage/net-misc/ntp/ntp-4.1.2.ebuild

And ntpdate run well.

but ntp-client fail, but i dont look for that.

ntp-client start, say:

```

* Setting clock via the ntp client 'ntpdate'...

ntpdate: unknown option -Q

usage: ntpdate [-bBdqsuv] [-a key#] [-e delay] [-k file] [-p samples] [-o version#] [-r rate] [-t timeo] [-U username] server ...

```

I think is an option is ntp-client or any config file.

Investigation comming soon

Yes...

ntp-client show -Q at comand line.

Delete it and work wery well...

Goodbye

----------

## lduperval

 *Deebster wrote:*   

> After you installed a new version of ntp, it probably pointed you at https://bugs.gentoo.org/show_bug.cgi?id=41827
> 
> In a nutshell, remove 'notrust' from the4 restrict settings in /etc/ntp.conf

 

This is my ntp.conf file:

```

restrict default

driftfile /etc/ntp.drift

logfile /var/log/ntp.log

server ntp1.cmc.ec.gc.ca

```

and it still doesn't work... Actually, ntpdate doesn't work. Using ntpd only seems to fix the problem.

Thanks,

L

----------

## Carlo

@bubuk: ntp1.ptb.de is a stratum 1 server. If you're not the admin of a fairly big organisation, using a stratum 1 is misuse. Please have a look at 

http://www.eecis.udel.edu/~mills/ntp/servers.html

for a stratum 2 server. If you don't need ultraprecision, you won't notice any difference.

Carlo

----------

## bubuk

Uh, Ah...

Didn't know that. Now i've changed it to a stratum 1 server.

Thanks and a nice Weekend to all....

----------

## MasterC

Just wanted to chime in and say I've got the same problem.  My ntp.conf is about as simple as everyone else's:

server 192.168.1.24

logfile     /var/log/ntpd.log

driftfile    /var/lib/ntp/ntp.drift

Yet I get the same error when using ntpdate:

```
setsockopt() IPV6_V6ONLY failed....
```

I am currently downgrading to ntp4.1.x  to fix it temporarily.

Cool

----------

## unnerve

i've had similiar problems (setsocketopt() IPV6..) with ntpdate/ntp on one of my computers, but fortuneately i have another where it is working. 

computer #1 works, acts as ntp server for the home LAN. it has

net-misc/ntp-4.2.0-r2

sys-kernel/gentoo-sources-2.4.25-r2

computer #2 ntp seems completely broken, my personal desktop.

net-misc/ntp-4.2.0-r2

sys-kernel/gaming-sources-2.4.20-r10

but when i boot #2 using an old 2.4.22-gentoo-r7 kernel i have lying around

ntp works as expected.

i've tried unmerging/remerging ntp, but no dice on the gaming kernel.

i found this bug report and it mentions to have ipv6 enabled in the kernel and/or use a -4 option on ntpdate. as far as i can tell i have ipv6 support in all kernels that i've tried and using a -4 option does not make a difference. so i'm still stuck, i don't want to drop the gaming-kernel but i want to be able to sync my time automatically. 

i would give the chrony package a try, but:

a) my brain is still fried from trying to fix this and doing a complicated sendmail/ssmtp/vixie-con setup to suit my needs and fixing old uid's migrated from a legacy redhat to have gentoo style uid's (>1000 instead of >500).

b) i'm already familiar and confident with setting up ntp.

c) i'm quitting for the day to go watch Inuyasha. 

d) i'm gonna read the source for ntp related to setsocketopt() and exmaine the ebuild tommorrow.

i hope this information might help lead to a solution, perhaps it's a kernel bug??

----------

## kezzla

Love the Avatar Paul9196 ! hhahahah

My ntpd is working fine. 3 winxp clients pointed at my linux server. 

Currently using >> kernel 2.6.6-rc3-love4

Was using 2.6.6-rc3, rc2, rc1 all the way down to 2.6.1...never had a problem.

Also Using:

net-misc/ntp-4.2.0-r2

----------

## lduperval

Ah. I'm still on a 2.4.x kernel.

----------

## infinyt9

*After an hour...*

well, I dont know if this is supposed to be fix, but it doesnt really matter,  I decided to go with 4.1.2... I mean, **** this, I wont waste time, I just want decent time!!!!

Maybe 4.2 should be masked? I dunno, just a thought from a long time gentoo user...

-------------------

*2 minutes later*

See see!!! It works!! damness, wasted sooooo much time

----------

## fmouse

i'm surprised that no one has apparently posted this as a bug.  I did.

See https://bugs.gentoo.org/show_bug.cgi?id=51721

----------

## Carlo

Just a note from the documentation:

 *Quote:*   

> Disclaimer: The functionality of this program is now available in the ntpd program. See the -q command line option in the ntpd - Network Time Protocol (NTP) daemon page. After a suitable period of mourning, the ntpdate program is to be retired from this distribution

 

----------

## paranerd

 *infinyt9 wrote:*   

> *After an hour...*
> 
> well, I dont know if this is supposed to be fix, but it doesnt really matter,  I decided to go with 4.1.2... I mean, **** this, I wont waste time, I just want decent time!!!!
> 
> Maybe 4.2 should be masked? I dunno, just a thought from a long time gentoo user...
> ...

 

100% agree. 

What's going on? What am I missing here? This has been a problem for months!

----------

## Enderson

Didn't work here! Just downgrading to 4.1.2.

----------

