System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to start XNTPD service

1221
Advisor

Failed to start XNTPD service

Hi,

 

Unable to start xntpd service after configuring ntp parameters in "/etc/ntp.conf" and "/etc/rc.config.d/netdaemons" file.

 

# more rc.log | grep xntp
Output from "/sbin/rc2.d/S660xntpd start":
"/sbin/rc2.d/S660xntpd start" SKIPPED

12 REPLIES
Patrick Wallek
Honored Contributor

Re: Failed to start XNTPD service

Can you please show us, or attach to this thread, the /etc/ntp.conf and /etc/rc.config.d/netdaemons files?

 

What happens if you run the start script manually?

 

# /sbin/init.d/xntpd start

Nighwish
Frequent Advisor

Re: Failed to start XNTPD service

Hi

 

your ntpd.conf musta have any rong configuration.

 

 

/sbin/init.d/xntpd stop

ntpdate ntp_server

/sbin/init.d/xntpd start

 

 ntpq -p ( and see if you have the correct ntp_servers)

 

If not. Go to /etc/ntp.conf and add the following lines to the end of the file:

server ntp_server
server ntp_slave_server

 

repeart the processe:

/sbin/init.d/xntpd stop

ntpdate ntp_server

/sbin/init.d/xntpd start

 

 ntpq -p ( and see if you have the correct ntp_servers)

 

Regards.

 

 

Bill Hassell
Honored Contributor

Re: Failed to start XNTPD service

> "/sbin/rc2.d/S660xntpd start" SKIPPED

 

SKIPPED means that the configure script in /etc/rc.config.d has NTP disabled. Edit the file:

 

       /etc/rc.config.d/netdaemons

 

and change the settings to:

 

export NTPDATE_SERVER=us.pool.ntp.org
export XNTPD=1
export XNTPD_ARGS="-l /var/adm/xntpd.log"

 where:

       us.pool.ntp.org is the NTP server to use when your server first boots up.

       XNTPD=1 will enable NTP service on bootup

       XNTPD_ARGS= the -l option is used to put NTP logs in a different log file (not syslog.log)

 

Warning: do not use ntpdate on a production system, especially one with databases and other time-sensitive applications. ntpdate will 'jump' the time which can cause some transactions to get out of sync. NTP will not sync the time if it is more than 10-12 minutes off. If the time is an hour or two off, DO NOT change the time (using date) until you verify that the $TZ value points to your local timezone. HP-UX always keeps Zulu or UTC time so your local time is translated using the TZ variable.

 

In your /etc/ntp.conf file, you should have something like this (delete all the comments):

 

server us.pool.ntp.org
server 0.north-america.pool.ntp.org
server 1.north-america.pool.ntp.org
server 2.north-america.pool.ntp.org
fudge 127.127.1.1 stratum 10
driftfile /etc/ntp.drift

 The pool servers are ideal as they are a very accurate source for NTP time. If you cannot reach the Internet directly, you can see if your firewall router supplies NTP sync like this:

 

      ntpq -p 1.2.3.4

 

where 1.2.3.4 is the iP address of your firewall. If ntpq reports that is supplying NTP sync, then use that IP address as your server in ntp.conf. 

 



Bill Hassell, sysadmin
1221
Advisor

Re: Failed to start XNTPD service

Hi, 

 

Thanks for your replies,

 

ntp.conf contents:

 

server cc01-dc10.kmc.edu version 3 prefer
server g04-dc12.kmc.edu version 3
peer dbs2.kmc.edu version 3
server 127.127.1.1 stratum 10
authenticate no
statsdir /var/tmp/ntp/
statistics loopstats
filegen loopstats file loopstats type day enable
filegen loopstats file loopstats type day link enable
driftfile /etc/ntp.drift

 

/etc/rc.config.d/netdaemons:

 

export NTPDATE_SERVER=cc01-dc10.kmc.edu
export XNTPD=1
export XNTPD_ARGS="-x"

 

nothing happened after starting the xntpd service

 

# /sbin/init.d/xntpd start
#

 

# ps -ef | grep ntp
root 28940 2446 1 07:51:56 pts/0 0:00 grep ntp

 

# ntpq -p
ntpq: read: Can't assign requested address

 

Also tried to add two servers into 

 

export NTPDATE_SERVER='cc01-dc10.kmc.edu g04-dc12.kmc.edu'
export XNTPD=1
export XNTPD_ARGS="-x"

 

# /sbin/init.d/xntpd stop

# /sbin/init.d/xntpd start

 

# ps -ef | grep ntp
root 29200 2446 0 07:57:09 pts/0 0:00 grep ntp

 

 

Failed to start the service from SAM as well, the sam log contains some errors; as follows;

 

07:58:07 ===== Wed Feb 15 07:58:07 2012 Entering SAM area "NTP (cngdbs1)".
07:58:07 * Performing task "Get current state of authentication
(authenticate yes or no).".
07:58:07 * Executing the following command:
ch_xntp -l authenticate
07:58:07 * Command completed with exit status 0.
07:58:07 * Task: "Get current state of authentication (authenticate yes or
no)." succeeded.
07:58:07 * Performing task "See if the XNTP daemon is running.".
07:58:07 * Executing the following command:
ps -el | grep xntpd
07:58:07 * Command completed with exit status 1.
07:58:07 ERROR The XNTP daemon is not running
07:58:07 * Performing task "List all PEER and SERVER entries in the
ntp.conf file.".
07:58:07 * Executing the following command:
ch_xntp -lx peer && ch_xntp -lx server
07:58:07 * Command completed with exit status 0.
07:58:07 * Task: "List all PEER and SERVER entries in the ntp.conf file."
succeeded.
07:58:19 * Performing task "Start the XNTP daemon.".
07:58:19 * Executing the following command:
. nnc_utils; XNTPD_update_netdaemons 1; export XNTPD=1; \
/sbin/init.d/xntpd start
07:58:19 * Command completed with exit status 2.
07:58:19 ERROR Task: "Start the XNTP daemon." failed. The return code was 2.
Standard error contains "".
07:58:19 ERROR
07:58:28 * Performing task "Get current state of authentication
(authenticate yes or no).".
07:58:28 * Executing the following command:
ch_xntp -l authenticate
07:58:28 * Command completed with exit status 0.
07:58:28 * Task: "Get current state of authentication (authenticate yes or
no)." succeeded.
07:58:28 * Performing task "See if the XNTP daemon is running.".
07:58:28 * Executing the following command:
ps -el | grep xntpd
07:58:28 * Command completed with exit status 1.
07:58:28 ERROR The XNTP daemon is not running
07:58:28 * Performing task "List all PEER and SERVER entries in thentp.conf file.".
07:58:28 * Executing the following command:
ch_xntp -lx peer && ch_xntp -lx server
07:58:28 * Command completed with exit status 0.
07:58:28 * Task: "List all PEER and SERVER entries in the ntp.conf file."succeeded.
07:58:37 * Executing the following command:
/usr/sam/bin/samlog_viewer -Z29276

 

 

 

Dennis Handly
Acclaimed Contributor

Re: Failed to start XNTPD service

07:58:19 * Executing the following command:
. nnc_utils; XNTPD_update_netdaemons 1; export XNTPD=1; /sbin/init.d/xntpd start
07:58:19 * Command completed with exit status 2.
07:58:19 ERROR Task: "Start the XNTP daemon." failed. The return code was 2.
Standard error contains "".

 

HmmYou might try executing this directly as root:

   /usr/sbin/xntpd -x; echo $?

1221
Advisor

Re: Failed to start XNTPD service

It returns 0.

# /usr/sbin/xntpd -x; echo $?
0
Dennis Handly
Acclaimed Contributor

Re: Failed to start XNTPD service

>It returns 0.

 

So did it demonize itself?  Is another copy still running?

1221
Advisor

Re: Failed to start XNTPD service

which copy you are talking about?

have the following files;

/etc # ll ntp*
-r--r--r-- 1 bin bin 19163 Feb 14 16:10 ntp.conf
-rw-r--r-- 1 root sys 0 Feb 14 13:59 ntp.drift
-rw-r--r-- 1 root sys 61 Feb 14 16:03 ntp.keys

/etc # ll rc.config.d/netd*
-rw-r--r-- 1 root sys 2202 Feb 15 07:58 rc.config.d/netdaemons
-rw-r--r-- 1 root sys 2202 Feb 15 07:55 rc.config.d/netdaemons.old
-r--r--r-- 1 root sys 2156 Feb 14 14:01 rc.config.d/netdaemons_org
Dennis Handly
Acclaimed Contributor

Re: Failed to start XNTPD service

>which copy you are talking about?

 

The copy(fork) of the xntpd process.  What does ps(1) show?

1221
Advisor

Re: Failed to start XNTPD service

All of a sudden it iss running now;

# ps -ef | grep ntp
root 14024 2446 0 10:49:38 pts/0 0:00 grep ntp
root 2620 1 0 08:55:04 ? 0:00 /usr/sbin/xntpd -x

# ntpq -p
remote refid st t when poll reach delay offset disp
==============================================================================
*cc01-dc10.kmc mirror 3 u 151 256 377 0.70 1.667 2.12
+g04-dc12.kmc cc01-dc10.kmc 4 u 9 256 377 0.75 2.029 5.83
+dbs2.kmc.edu cc01-dc10.kmc 4 u 186 256 377 0.23 -1.251 0.60

Thanks for your help.
Bill Hassell
Honored Contributor

Re: Failed to start XNTPD service

/etc # ll rc.config.d/netd*
-rw-r--r-- 1 root sys 2202 Feb 15 07:58 rc.config.d/netdaemons
-rw-r--r-- 1 root sys 2202 Feb 15 07:55 rc.config.d/netdaemons.old
-r--r--r-- 1 root sys 2156 Feb 14 14:01 rc.config.d/netdaemons_org

 *NEVER*, EVER leave junk files in the rc.config.d directory. This rule applies to every version of HP-UX. During bootup, *every* file in this directory is sourced into the rc startup environment. They are sourced in alphabetical order so in your small example above, netdaemons_org was run last and therefore set the environment. This is the only directory like this in HP-UX, so move *all* the junk files in this directory to another directory immediately. I usually create an old directory like this:

 

mkdir /etc/rc.config.d/old

 then move all the old junk into old. I have seen a machine down for two days because a test version of netconf (called netconf.test) was left in the rc.config directory, and the system always failed to start networking due to the bad file. Also get rid of any accidental files created by sitting in this directory and editing unrelated files.



Bill Hassell, sysadmin
basant
Frequent Advisor

Re: Failed to start XNTPD service

I have already faced the same issue. below is tested solutioin
Run a command ,
#xntpd -b

after that check
# ps -eaf | grep -i ntp
root 2488 1 0 Jan 7 ? 3:31 xntpd
root 24344 21824 0 03:32:09 pts/1 0:00 grep -i ntp
Basant Sharma