Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Port in use on Solaris 9

Posted on 2004-10-27
5
Medium Priority
?
11,750 Views
Last Modified: 2013-12-21
I want to see if port 389 is listening on Solaris.  What's the best way?
0
Comment
Question by:lcor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 19

Expert Comment

by:ramazanyich
ID: 12426719
run
#netstat
you will see all established and waiting connection.
check for lines with LISTENINg on it.
If something is runnning on port 389 you will see it.
0
 
LVL 38

Assisted Solution

by:wesly_chen
wesly_chen earned 400 total points
ID: 12426748
netstat -a
You need "-a" option.

Wesly
0
 
LVL 19

Accepted Solution

by:
ramazanyich earned 600 total points
ID: 12426822
sorry it should be
#netstat -a

or better to see only daemons:
#netstat -a | grep LISTEN

In lines check that ldap or 389 doesn't exist in first column. It means that there is no daemon listening on port 389.

0
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 400 total points
ID: 12427177
Another way is to telnet to the port, eg:

telnet localhost 389
0
 
LVL 38

Assisted Solution

by:yuzh
yuzh earned 600 total points
ID: 12429288
netstat is the tool for the job, eg: to check the occupied port being used and the
appplication who use them, use command:

netstat –anP tcp

To find out the program listening
to a paticular tcp port

netstat -a | grep LISTEN | grep port-no

    check port 80:
    netstat -a | grep LISTEN | grep 80

man netstat
to learn more details.

and see http:Q_20887412.html

If you want to find out the process ID run on a particular port, you can use the following
script:

#!/usr/bin/ksh

echo -n "which port?> "
read port

for pid in `ps -ef -o pid | tail +2`
do
  foundport=`pfiles $pid 2>&1 | grep "sockname:" | grep "port: $port$" |
awk
'{print $NF}'`
  if [ "$foundport" != "" ]; then
    foundproc=`pfiles $pid 2>&1 | grep "^$pid:"`
    echo "$foundproc, $foundport"
  fi
done

exit

# End of script


Another good tool for the job is "lsof" you can download it from:
http://sunfreeware.com/



0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question