[comp.unix.aux] getservbyname

jsin@island.seas.ucla.edu (John Sin) (12/22/89)

I have just finished porting "timed" to A/UX, and I've ran into a small
problem.  First time I ran it, I got a message "timed/udp service not
available" because getservbyname( "timed", "udp") returns NULL.  So I 
added a line in /etc/services thus:
	timed     525/udp     timeserver
However, I found that it still does not recognize this service.  I've
already rebooted (soft boot) the machine, but that didn't make any
difference.  

My understanding is that getservbyname() call only looks at the file
/etc/services, but is there some other file I need to change, or is this a
bug?

I also found that if I delete a line from /etc/services - say, smtp -
getservbyname() still can find smtp.

Looks to me like a bug, but I wanted to know what others think.
I'm running Mac IIx (with 68030 processor upgrade) and AUX 1.1.

Speaking of bugs, gettimeofday(), in it's timezone struct, returns
number of SECONDS from GMT zone, not MINUTES as dictated in the man page.
Also, the C compiler goes into infinite loop when dealing with some switch
statemetns.  Finally, default sendmail.cf file is a trash - it can send
mail, but it can not receive any mail (I refuse to speak to myself is the
error message) from our other machines.

Any comments will be appreciated.

John Sin
John (Jonghoon) Sin       (Above opinions are my own and etc, etc, etc...)
UCLA SEASnet Facilities   InterNet: jsin@seas.ucla.edu
2567 Boelter Hall         UUCP: ...!(uunet,ucbvax,rutgers)!seas.ucla.edu!jsin
Los Angeles, CA. 90024    (213) 825-3556

aem@mthvax.cs.miami.edu (a.e.mossberg) (12/23/89)

In article <30183@shemp.CS.UCLA.EDU> jsin@island.seas.ucla.edu (John Sin) writes:
>I have just finished porting "timed" to A/UX, and I've ran into a small
>problem.  First time I ran it, I got a message "timed/udp service not
>available" because getservbyname( "timed", "udp") returns NULL.  So I 
>added a line in /etc/services thus:

>	timed     525/udp     timeserver

>However, I found that it still does not recognize this service.  I've
>already rebooted (soft boot) the machine, but that didn't make any
>difference.  


Did you remember to add it to /etc/servers ?  You'll need to add a 
line which defines where the daemon lives so that inetd can find it
when a request comes in. 



aem
--
a.e.mossberg / aem@mthvax.cs.miami.edu / aem@umiami.BITNET / Pahayokee Bioregion
Light parted from darkness, day from night, earth from the primal waters, and 
the voice of Paul Robeson was divided from the silence. - Pablo Neruda

louis@asterix.drev.dnd.ca (Louis Demers) (12/23/89)

jsin@island.seas.ucla.edu (John Sin) writes:
>... So I added a line in /etc/services thus:
>	timed     525/udp     timeserver
>However, I found that it still does not recognize this service.  I've
>already rebooted (soft boot) the machine, but that didn't make any
>difference.  
...
>I also found that if I delete a line from /etc/services - say, smtp -
>getservbyname() still can find smtp.

Are you running  the Yellow Pages ?  Here we are and we once
encoutered the same problem on Sun's.  "/etc/services" is one of the files
"shared" by the Yellow Pages system.  The file /etc/services on
the master server is the one that need to be changed.

	Merry Xmas,

						Louis
-- 
| Louis Demers              | DREV, Defence Research Establishment,Valcartier |
| louis@asterix.drev.dnd.ca | POBox 8800, Courcelette,Quebec, CANADA, G0A 1R0 |
|            (131.132.48.2) | Office: (418) 844-4424       fax (418) 844-4511 |
+---------------------------+-------------------------------------------------+

jhc@iris.brown.edu (James H. Coombs) (12/25/89)

In article <30183@shemp.CS.UCLA.EDU> jsin@island.seas.ucla.edu (John Sin) 
writes:
> I also found that if I delete a line from /etc/services - say, smtp -
> getservbyname() still can find smtp.

Are you running yellow pages?  If so, you need to update /etc/services on
the yellow pages server.  Try /bin/ypwhich.

--Jim

Dr. James H. Coombs
Senior Software Engineer, Research
Institute for Research in Information and Scholarship
Box 1952, Brown University, Providence, RI 02912