/usr/bin/ntpd: unknown option -U then it lists the recognized options and gives a * Failed to start error messege Reproducible: Always Steps to Reproduce: 1. 2. 3.
*** This bug has been marked as a duplicate of 31258 ***
change it to -u
ok how can i determine now if its working... changing /etc/conf.d/ntpd config to -u gets rid of the startup error but now ntpq -p gives nypq: read: Connection refused
also * Stopping ntpd.... /sbin/runscript.sh: line 34: kill: (1279) - No such process * Starting ntpd.... so without ntpq -p how are you sure this is actually running
sorry the above was from /etc/init.d/ntpd restart .... supposedly ntpd was started at boot , i.e. rc-update add ntpd default.... but if ntpd isnt working you will get the same error on restart this is producing... say if the clock is way off ntpd will fail to start but will appear to when init..d does its thing but restart will give the error above.
ntpd is not in the business of setting your clock, it's in the business of maintaining it ... from the manpage: Most operating systems and hardware of today incorporate a time-of-year (TOY) chip to maintain the time during periods when the power is off. When the machine is booted, the chip is used to initialize the operat- ing system time. After the machine has synchronized to a NTP server, the operating system corrects the chip from time to time. In case there is no TOY chip or for some reason its time is more than 1000s from the server time, ntpd assumes something must be terribly wrong and the only reliable action is for the operator to intervene and set the clock by hand. This causes ntpd to exit with a panic message to the system log. The -g option overrides this check and the clock will be set to the server time regardless of the chip time. However, and to protect against broken hardware, such as when the CMOS battery fails or the clock counter becomes defective, once the clock has been set, an error greater than 1000s will cause ntpd to exit anyway. as for the init script failing, i dont know how much i can do about that ... the server started up normally and then exited [per above] ... the only signs it leaves is in your system logs
yes i know what the purpose of ntpd is... i was simply making the comaprison of somethings i noticed caused ntpd to fail at startup and how the errors upen a restart are similar... this is broken... 4.1.2 works perfectly can you tell me how to verify that its actually polling the servers its set to sync against?
you get that error upon restart becuase ntpd exited abnormally run this: /etc/init.d/ntpd zap killall ntpd /etc/init.d/ntpd start ps aux | grep ntpd is ntpd running ?
I am having the same problem with 4.2.0. When I start it from the init script it seems to behave as normal, but there is no process running. The pid located in /var/run/ntpd.pid does not exist. This is the output of /usr/bin/ntpd -p /var/run/ntpd.pid -u ntp:ntp -ddd on my system: ntpd 4.2.0@1.1161-r Sun Feb 15 04:08:03 PST 2004 (1) addto_syslog: ntpd 4.2.0@1.1161-r Sun Feb 15 04:08:03 PST 2004 (1) addto_syslog: set_process_priority: Leave priority alone: priority_done is <2> addto_syslog: precision = 1.000 usec create_sockets(123) addto_syslog: no IPv6 interfaces found address_okay: listen Virtual: 1, IF name: lo, Up Flag: 1 address_okay: listen Virtual: 1, IF name: eth0, Up Flag: 1 bind() fd 4, family 2, port 123, addr 0.0.0.0, flags=8 flags for fd 4: 04002 bind() fd 5, family 2, port 123, addr 127.0.0.1, flags=0 flags for fd 5: 04002 bind() fd 6, family 2, port 123, addr 192.168.100.2, flags=8 flags for fd 6: 04002 create_sockets: ninterfaces=3 interface 0: fd=4, bfd=-1, name=wildcard, flags=0x8 sin=0.0.0.0 bcast=0.0.0.0, mask=255.255.255.255 interface 1: fd=5, bfd=-1, name=lo, flags=0x5 sin=127.0.0.1 mask=255.0.0.0 interface 2: fd=6, bfd=-1, name=eth0, flags=0x9 sin=192.168.100.2 bcast=192.168.100.255, mask=255.255.255.0 init_io: maxactivefd 6 local_clock: at 0 state 0 usage: /usr/bin/ntpd [ -abdgmnx ] [ -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 ] The usage thing at the end would appear to indicate an error in the command, but I cannot see a problem. emerge info (in case it helps): Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.2, glibc-2.3.3_pre20040207-r0, 2.6.3-rc2-gentoo) ================================================================= System uname: 2.6.3-rc2-gentoo i686 AMD Athlon(tm) XP 1700+ Gentoo Base System version 1.4.3.13 distcc 2.12.1 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.3 [enabled] Autoconf: sys-devel/autoconf-2.59 Automake: sys-devel/automake-1.8.2 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache emergemail sandbox userpriv" GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://dark-lord.ihtruelsen.dyndns.org/gentoo-portage" USE="3dnow X aalib acpi alsa apm arts avi berkdb bonobo crypt cups directfb dvd encode esd fbcon flash foomaticdb gdbm gif gnome gpm gtk gtk2 gtkhtml guile imap imlib java jpeg kde ldap libg++ libwww mad maildir maznocompose mikmod motif moznoirc moznomail mpeg mysql ncurses nls oggvorbis opengl oss pam pdflib perl png python qt quicktime readline sdl slang slp spell ssl svga tcltk tcpd tetex tiff truetype usb x86 xface xml2 xmms xv zlib"
well no... ps aux | grep ntpd returns nothing... i'm telling ya its broken... if 4.1.2 fails to start... say because the system time is way off you'll get that same error running ntpq -p that you get with 4.2.0
I should have also noted that it does not write anything to /var/log/ntpd.log as specified in my conf file, so I don't think that it is sourcing it. I tried adding -c /etc/ntp.conf to the command line without any luck.
I can confirm this: root sephora # /etc/init.d/ntpd restart * Stopping ntpd... /sbin/runscript.sh: line 34: kill: (24060) - No such process [ ok ] * Starting ntpd... [ ok ] root sephora # ps -ef | grep ntp root 8688 7573 0 16:26 pts/0 00:00:00 grep -E ntp
I think this issue is still related to the -u flag, trying to run it directly as "ntp -u ntp:ntp" still fails to start.. but without it starts fine.
sorry "ntpd -u ntp:ntp".. additionally it runs via init.d by commenting out the extra flags from conf.d/ntpd, definatly a -u problem.. you may notice that ntpd --help not longer shows the -u flag as well.
oh, i'm retarted USE=droproot emerge ntp then '-u user:group' will work i'll update the logic/use flag so it's 'nodroproot' and thus, by default, ntp drops to ntp:ntp
cool! =) however, I would try it but I think I broke autoconf.. so now I cant rebuild it so it works for me. DOH! :)
ok, fixed in cvs if you dont feel like re-emerging to get droproot support, then edit your /etc/conf.d/ntpd and remove the '-u ntp:ntp'
no probs.. I worked around it.. seems to be some trouble with the latest autoheader stuff.. Anyhow, I can confirm ntpd works wit hthe -u flag! =)
i'm using sys-devel/autoconf-2.59 and sys-devel/automake-1.8.2 and i dont have any problems other than i think the autotools take way too long to run
sys-devel/autoconf-2.59-r1 here, but I *think* its a known problem.. I have always tried to steer away from trying to resolv issues with autoconf, it scares me :)
yeah i just emerged autoconf-2.59-r1 and ntp fails to build.... now what?
i'll have to review autoconf 2.50-r1 since 2.50 works just fine i'm not going to do it now cause i'm doing homework :p chances are, either i'll fix it so it'll work with 2.50-r1 and i'll post here, or i'll open a new bug saying 2.50-r1 is broken
I worked around it possibly a dangerous way.. mv /usr/bin/autoheader /usr/bin/autoheader-bak; ln -s /usr/bin/autoheader-2.59 /usr/bin/autoheader It compiled fine after that. I undone my work around immediatly afterward ntp was isntalled though =)
maybe better to refer to this: http://bugs.gentoo.org/show_bug.cgi?id=41723#c2 I have not yet tried it myself.