1833777 Members
2835 Online
110063 Solutions
New Discussion

getservbyname

 
Patricia Tang
Advisor

getservbyname

Hi All,

My application having problem in getservbyname.
Error messages of "Systemerror = " prompt out.

Currently my system have apply NIS.

Please advise.

Thanks.

Regards,
Pat
6 REPLIES 6
harry d brown jr
Honored Contributor

Re: getservbyname

Have a look at ypserv and ypfiles:

http://www.informatik.uni-frankfurt.de/doc/man/hpux/getservent.3n.html

If the system is running Network Information Service (NFS), getservbyname() gets the service information from the NIS server (see ypserv(1M) and ypfiles(4)).

http://www.informatik.uni-frankfurt.de/doc/man/hpux/ypserv.1m.html
http://www.informatik.uni-frankfurt.de/doc/man/hpux/ypfiles.4.html

live free or die
harry

Live Free or Die
Steven Sim Kok Leong
Honored Contributor

Re: getservbyname

Hi,

Was /etc/services recently updated?

If /etc/services was updated but NIS was not aware, then you need to update the NIS yellow pages by running make inside /var/yp:

# cd /var/yp
# make

Hope this helps. Regards.

Steven Sim Kok Leong
Patricia Tang
Advisor

Re: getservbyname

Hi steven,

Thanks for replying.

The NIS is always update.

My Current Server act as NIS Client.

Please advise.

Thanks

Regards,
Pat
S.K. Chan
Honored Contributor

Re: getservbyname

The function getservbyname usually need to access to certain files (eg: /etc/services being one of them), I'm guessing you have some permission problem on those files which prevent getservbyname from reading it. To start of, check permission of /etc/services (should be 444), also check permission of other files like /etc/hosts and /etc/inetd.conf
Patricia Tang
Advisor

Re: getservbyname

Hi Chan,

Yes. I agree with you. cause i did modify file permission somewhere last week for security purpose.

But i can't remember what file i did change.
I have check those file that u meantion ( /etc/host, /etc/hosts.equiv , /etc/inetd.conf,/etc/services ) all permission have set to 444

if there any other file i need to concern???

Many Thanks.

Regards,
Pat


S.K. Chan
Honored Contributor

Re: getservbyname

Others that I can think of .. (all should have at least 444)..
In /etc
resolv.conf
nsswitch.conf
networks
netgroup
netmasks
netconfig
In /var/adm
inetd.sec

Are you able to trace which file/files permission did you change ? Check .sh_history (if you got one setup -- hopefully) for previous executed commands. What about comparing the files permission with that of other NIS client box that worked fine.