ntpq: ntp/udp: unknown service -Question on ntpd/ntpq

Ok here is my problem.

At the moment I am trying to set up one of my machine (PC104 - QNX) to act as an ntp server and I have another machine (PC104 - Linux) which shall synchronise it time to my QNX box.

At the moment I am trying to setup ntp on my QNX box.

I have the following binaries installed on ntpd , ntpdate , ntpdc , ntpq , ntptrace …

not sure if I needed all these but when I was building my QNX image on my CF card I just chucked in anything that began with ntp*

anyways I currently have an ntp.conf (path of ntp.conf is /etc/ntp/ntp.conf ). The ntp.conf file which looks like this

[color=blue]# /etc/ntp.conf, configuration for ntpd

[color=red]driftfile /tmp/lib/ntp/ntp.drift <<------- Not sure if this is correct …is this the correct path …or can it be anything
statsdir /tmp/log/ntpstats/

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

You do need to talk to an NTP server or two (or three).


… and use the local system clock as a reference if all else fails

NOTE: in a local network, set the local stratum of one stable server

to 5; otherwise your clocks will drift apart if you lose connectivity.

sync to own clock if cannot connect to ntp server

fudge stratum 5

By default, exchange time with everybody, but don’t allow configuration.

See /usr/share/doc/ntp-doc/html/accopt.html for details.

restrict default kod notrap nomodify nopeer noquery

Local users may interrogate the ntp server more closely.

restrict nomodify

I then try to start my ntp … At the moment I am trying to synchronise my SERVER(The QNX box) NTP to an external university NTP server.

by first doing
then doing

I then try to Monitor the NTP daemon
by doing
But the I get the error msg
ntpq: ntp/udp: unknown service :question:

is it a problem with my inetd.conf file ?..
which currently looks like this

[color=blue]# @(#)inetd.conf 1.23 90/01/03 SMI

Configuration file for inetd.

To re-configure the running inetd process, edit this file, then

send the inetd process a SIGHUP.

Internet services syntax:

<service_name> <socket_type> <server_pathname>

Time service is used for clock syncronization.

#time stream tcp nowait root internal
#time dgram udp wait root internal

Ftp and telnet are standard Internet services.

ftp stream tcp nowait root /usr/sbin/ftpd in.ftpd -l
telnet stream tcp nowait root /usr/sbin/telnetd in.telnetd

Shell, login, exec are BSD protocols.

#shell stream tcp nowait root /usr/sbin/rshd in.rshd
#login stream tcp nowait root /usr/sbin/rlogind in.rlogind
#exec stream tcp nowait root /usr/sbin/rexecd in.rexecd

Tftp service is provided primarily for booting. Most sites run this

only on machines acting as “boot servers”.

#tftp dgram udp wait root /usr/sbin/tftpd in.tftpd

Systat and netstat give out user information which man be

valuable to potential “system crackers.” Many sites choose to disable

some or all of these services to improve security.

#systat stream tcp nowait root /bin/ps ps -auwwx
#netstat stream tcp nowait root /usr/bin/netstat netstat -f inet

IPv6 services.

The only difference with the above is “tcp6” instead of “tcp”.

Be sure to enable both “tcp” and “tcp6” when you need service for

both IPv4/v6.

#ftp stream tcp6 nowait root /usr/sbin/ftpd ftpd -ll
telnet stream tcp6 nowait root /usr/sbin/telnetd telnetd
#shell stream tcp6 nowait root /usr/sbin/rshd rshd -L
#login stream tcp6 nowait root /usr/sbin/rlogind rlogind -L
#tftp dgram udp6 wait root /usr/sbin/tftpd tftpd -l -s /tftpboot

ntp dgram udp6 nowait root /usr/sbin/ntpd ntpd

Neutrino specific services

#pidin stream tcp nowait root /bin/pidin pidin
#pidinmem stream tcp nowait root /bin/pidin pidin mem
#pidinarg stream tcp nowait root /bin/pidin pidin arg
#pidinenv stream tcp nowait root /bin/pidin pidin env
#pidinsig stream tcp nowait root /bin/pidin pidin sig
#phrelay stream tcp nowait root /usr/bin/phrelay phrelay -x

Echo, discard, daytime, and chargen are used primarily for testing.

#echo stream tcp nowait root internal
#echo dgram udp wait root internal
discard stream tcp nowait root internal
discard dgram udp wait root internal
#daytime stream tcp nowait root internal
#daytime dgram udp wait root internal
#chargen stream tcp nowait root internal
#chargen dgram udp wait root internal

I’m still new to this ntp stuff …can someone please advise me on what I am doing wrong


Did the ntpdate work?
This is what I see.


15 Jul 11:27:41 ntpdate[258067]: adjust time server offset -0.00381
4 sec

This is what I have in my ntp.conf file.

server iburst prefer

driftfile /fs0p1/etc/ntp/ntp.drift

I am starting ntpd like this
ntpd -g -c /fs0p1/etc/ntp/ntp.conf
the -c for the ntp.conf file
and the -g for increasing the panic threshold. (I found that if the time was too far out then ntpd just gave up and died, -g stops this happening)

yes the ntpdate & ntpd command seems to work …but I will only know for sure until I query it using ntpq

…the behavior of ntpdate seems to be the same as what you have written above

…the question is why do i get

ntpq: ntp/udp: unknown service

when I run the ntpq command ??

Just had a look back in my emails.
I thought this problem rang a bell.

Try adding
ntp 123/udp
to your /etc/services

thats fixed the same error for me.


Hmm I dont seem to have this file in my /etc directory …is this file essential for QNX service to operate properly …

I have other service running like telnet just fine …without it …

Do you think that if I create a blank services file

and include

ntp 123/udp in it …everything will start working ?

I will try and give this a go