netstat
When the programe is failed for the port is already in use, you can use netstat command to investigate this error to find out the root cause.
If the server is Linux operating system without considering the Kernel version, Good luck, the option -p will show the PID and the program name.
netstat -anp
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
lsof
2) or the lsof command with -i option, for example:
[root@olinfa ~]# lsof -i:22
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sshd 1742 root 3u IPv4 11025 0t0 TCP *:ssh (LISTEN)
sshd 1742 root 4u IPv6 11027 0t0 TCP *:ssh (LISTEN)
sshd 2016 root 3u IPv4 13453 0t0 TCP olinfa:ssh->192.168.211.1:62290 (ESTABLISHED)
BTW, lsof is avariable on HP-Unix, but the lsof needs root permission to list all of the results.