[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Port in use on Solaris 9

Posted on 2004-10-27
5
Medium Priority
?
11,760 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
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses

590 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