LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-29-2008, 04:24 AM   #1
duyuyang
Member
 
Registered: Mar 2008
Posts: 56

Rep: Reputation: 16
System boot hangs at Starting NTP server: ntpd. WHY?


After I recompiled the kernel, I reboot the machine, but it hangs at:
INIT: Entering runlevel: 2
Starting OpenBSD Secure Shell server: sshdNET: Registered protocol family 10
lo: Disabled Privacy Extensions
IPv6 over IPv4 tunneling driver
.
Starting NTP server: ntpd.
I thought it was the ntpd init script, and I removed all the links in rc*.d, but the booting process hanged without "Starting NTP server: ntpd."

I don't know what to do. Any help?

shawn
 
Old 10-29-2008, 04:39 AM   #2
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
Look at the order of the start scripts - what comes after 'ntpd' and what could go wrong with it?
 
Old 10-29-2008, 05:56 AM   #3
duyuyang
Member
 
Registered: Mar 2008
Posts: 56

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by pinniped View Post
Look at the order of the start scripts - what comes after 'ntpd' and what could go wrong with it?
the script order after ntp is:
S99rc.local -> ../init.d/rc.local
S99rmnologin -> ../init.d/rmnologin
S99stop-bootlogd -> ../init.d/stop-bootlogd
If I use the original kernel, the init process completes OK.

IS the same init scripts the reason?
 
Old 10-29-2008, 06:14 AM   #4
duyuyang
Member
 
Registered: Mar 2008
Posts: 56

Original Poster
Rep: Reputation: 16
I tested, it is not the init scripts in run level 2, because scripts are executed successfully.
But what follows init scripts in the boot process to eventually get a login prompt?
 
Old 10-29-2008, 06:35 AM   #5
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
The "init" program is ultimately responsible for setting up the login prompt and so on. For example, on Linux the init program processes the /etc/inittab file to set up the various virtual consoles, serial consoles, and dial-in programs. I can't remember the details of the order of things so I don't know if 'inittab' is processed before or after the runlevel init scripts.

Does the computer really hang, or can you still log in via sshd?

Since you say everything works fine with your previous kernel, you should look at the differences in the configuration of your older kernel and your new one.
 
Old 10-29-2008, 08:47 AM   #6
duyuyang
Member
 
Registered: Mar 2008
Posts: 56

Original Poster
Rep: Reputation: 16
The problem is resolved. It is the tty that is not configured.
Thank you any way. And the computer does not really hang, I can still log in via ssh.

Shawn
 
Old 09-30-2016, 11:47 PM   #7
Digger1
LQ Newbie
 
Registered: Sep 2011
Location: Colorado Springs, CO
Distribution: Debian Squeeze
Posts: 24

Rep: Reputation: 0
I recently had a problem similar to this. I tracked it down to the use of the "-q" switch in the

Code:
NTPD_OPTS='g'
line in the "/etc/default/ntp" file.

IHTH someone!

Last edited by Digger1; 09-30-2016 at 11:48 PM.
 
Old 10-02-2016, 10:17 AM   #8
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060
A couple of things may cause problems as you describe.

Is your system connected to the Internet; i.e., do you have an Ethernet connection to your router or are you using Wi-Fi?

When NTP starts it queries the server(s) you have defined in /etc/ntp.conf, staring with 127.127.1.0 then the server(s) you have active. You can get long delays if the network is unreachable before each server times out.

I have a laptop that is normally connected via Ethernet to the router, but, if it is off in remote land somewhere it will take some time to boot without a wi-fi connection.

Just for grins, your /etc/ntp.conf file ought to look like this:
Code:
server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 10

#
# NTP server (list one or more) to synchronize with:
server 0.pool.ntp.org iburst
server 1.pool.ntp.org iburst
server 2.pool.ntp.org iburst
#server 3.pool.ntp.org iburst
That is, localhost is first, followed by three pool servers (three is the most you would want to use). If, for some reason, any of those are unreachable you will have delays waiting for timer-out. One server is not enough, two is OK, three seems to be the most efficient (and I'm not real sure about iburst but I leave it alone). Too, you definitely do want to have the local clock lines enabled so that, if you lose your network connection NTP will fall back on itself and keep synchronized with itself until the network comes back.

/etc/rc.d/rc.ntpd includes the -g option so that the system clock (the software clock) first adjustment can be Big. This allows correction in the event that the system clock is more than 1000 seconds off. That can happen with a dead battery on your motherboard when the hardware clock is way off -- the system clock is initiated from the hardware clock on boot. Once synchronized with an external source, the system clock will be correct and, when you shut down NTPD, the correct time will be written to the hardware clock for the next boot (and, hopefully, the hardware clock is then running on time).

The man page for ntpd states:
Quote:
Normally, ntpd exits with a message to the system log if the offset exceeds
the panic threshold, which is 1000 s by default. This option allows the time
to be set to any value without restriction; however, this can happen only
once. If the threshold is exceeded after that, ntpd will exit with a message
to the system log. This option can be used with the -q and -x options. See
the tinker configuration file directive for other options.
Basically, it's not a real good idea to remove -g from /etc/rc.d/rc.ntpd.

By the way, this month's issue (0ct 2016) of Linux Journal includes an article by Eric S. Raymond, NTPsec a Secure, Hardened NTP Implementation: Network time service has been in trouble. Now it's getting a makeover. Darned interesting piece (like anything Raymond writes).

The times they're gonna be changing.

Hope this helps some.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Starting system message bus :dbus --ldap client hangs at this stage sarajevo Linux - Server 1 02-05-2010 02:03 PM
System Hangs during boot (starting HAL daemon ) on FC 6 32 bit with pentium D karthik_arnold1 Linux - Hardware 1 04-21-2008 01:05 PM
Hangs on boot at Starting Hotplug Subsytem... xerxesdaphat Linux - Software 7 02-23-2006 08:16 AM
KDE Hangs at Starting System Services... Snabber Linux - General 3 11-03-2004 08:31 AM
NTPd - ntp.conf warath Linux - Software 8 04-05-2004 09:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration