1832936 Members
2565 Online
110048 Solutions
New Discussion

/etc/services

 
SOLVED
Go to solution
maria paschali
Frequent Advisor

/etc/services

Hi,

I need some clarification.

I am running HPUX 11.0. my /etc/services file contains the usual information as well as an additional line:

# Masterpiece/Net port
mpnet 20000/tcp

My boss tells me that when I rebooted last night it didn't pick this up, and started the services for the application that is why people had communication problems.

I am now confused, because I thought the /etc/services file was an information guide of what is run on which port when it runs. I am thinking that the reason it didn't run because there wasn't a startup script that should of been in the run levels somewhere.

Am I wrong?

/me thinks he is confused with windows and unix.

maria
4 REPLIES 4
Dayanand Naik
Frequent Advisor
Solution

Re: /etc/services

Hi Maria,

C /etc/services file contains a list of ports either on tcp/udp connection eg: finger 79/tcp. An entry of finger will be there in
inetd.conf file which is processed at run time when the system starts up. If there is no entry in the /etc/service file then the process will not start up.

Other than that there are plenty of other servives defined, but these are not necessarily required. But the application using it will open or talk thru the port. If the port entry is available on the /etc/services file.

So make sure that the application using this port is up and running.

Hope this helps.

Regards,
Dayanand Naik
Dayanand Naik
Michael Tully
Honored Contributor

Re: /etc/services

Hi Maria,

/etc/services is an *information* file relating
to which ports are being used by what applications.
At a guess I would say that when this application was installed, during the actual installation it added the entry to /etc/services

In saying that some applications do not do
a complete the job and fail to add a proper start-up script to /sbin/init.d or create a link to the /sbin/rc3.d directory or where the appropriate run level. Check in the /etc/rc.log file for the applications that got started. Also check using 'netstat -a' to see if the port is listening.

HTH
-Michael
Anyone for a Mutiny ?
David Allen
Frequent Advisor

Re: /etc/services

Hi Maria,

To quote the HP man page for /etc/services, it "associates official services and aliases with the port number and protocol the services use." The ports 0 to 1023 are reserved for specific services, eg telnet uses port 23 protocol tcp, ftp uses port 21 protocol tcp, etc.

You already have the Masterpiece port/protocol defined in your services file, so I would check to see if you have a start up script in the /sbin/init.d directory. Remember, the script should have symbolic links pointing to it from the runlevel directories. ie one to start it and one to stop it.

For example,

1. /sbin/init.d/mpnet (or whatever the name of the Masterpiece script is)
2. /sbin/rc3.d/Snnnmpnet -> /sbin/init.d/mpnet(where rc3.d means that Masterpiece starts at runlevel 3 - usually the default runlevel and the Snnn is a number representing the order that this file is started)
3. /sbin/rc2.d/Knnnmpnet -> /sbin/init.d/mpnet (where rc2.d is the runlevel that stops Masterpiece - in this case runlevel 2)

If the Masterpiece script exists, check the /etc/rc.log file for any errors at startup. Also check in the /etc/rc.config.d directory, as this may contain a file used by your Masterpiece program. If you have the start/stop script setup correctly, you can enable or disable Masterpiece from starting or stopping by modifying the corresponding Masterpiece file in /etc/rc.config.d

Regards,
Dave
Santosh Nair_1
Honored Contributor

Re: /etc/services

A couple of other things to check are /var/adm/syslog/syslog.log which lists all the services registered with inetd, so if in fact something was registered in inetd.conf and inetd was restarted, there should be a message to that affect in the syslog.

Also, you can see if the service is listening by doing a netstat -na|grep 20000|grep LISTEN. If all is set up properly, you should get something back.

-Santosh
Life is what's happening while you're busy making other plans