LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 08-25-2007, 12:48 PM   #1
Marv Bon
LQ Newbie
 
Registered: Aug 2007
Posts: 18

Rep: Reputation: 0
Could not listen on UDP socket: address is in use.


I am using OpenBSD 3.6, everything works perfect except SYSLOG. I need help.

How can I open the UDP sockets so SYSLOG can get messages from Cisco equipment?
 
Old 08-25-2007, 02:45 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
i don't undersatnd what your title has to do with the question... sounds like you need to configure the syslog server correctly and restart it. if you're getting that already in use message i'd assume that syslog is still running and you're trying to start another instance, which naturally isn't possible. not sure if it runs under bsd (no reason why not) but i would recommend syslog-ng for easier networked syslog reception. or even splunk to go to a whole new web 2.0 world of logging.

also openbsd is not linux... thread should shortly be moved to bsd forum.
 
Old 08-25-2007, 02:49 PM   #3
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Evidently, some other process is listening on that port. The first steps to solving your problem are to find out to which port the error refers, and which process is already listening, and then a determination can be made about a remedy. The tools lsof and/or netstat should allow you to locate the offending process. You will have to do a little sidebar research to determine which specific port is being referenced.
--- rod.
 
Old 08-25-2007, 03:18 PM   #4
Marv Bon
LQ Newbie
 
Registered: Aug 2007
Posts: 18

Original Poster
Rep: Reputation: 0
Here is the output of netstat -an

netstat -a
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp 0 0 LAXBCASTDNS01.2393 LAXBCASTDNS01.domain TIME_WAIT
tcp 0 0 LAXBCASTDNS01.smtp 10.11.50.1.59325 TIME_WAIT
tcp 0 116 LAXBCASTDNS01.ssh 10.6.50.1.2587 ESTABLISHED
tcp 0 0 LAXBCASTDNS01.ssh 10.6.50.1.2445 ESTABLISHED
tcp 0 0 *.ssh *.* LISTEN
tcp 0 0 *.submissi *.* LISTEN
tcp 0 0 *.smtp *.* LISTEN
tcp 0 0 *.time *.* LISTEN
tcp 0 0 *.daytime *.* LISTEN
tcp 0 0 *.auth *.* LISTEN
tcp 0 0 localhost.953 *.* LISTEN
tcp 0 0 LAXBCASTDNS01.domain *.* LISTEN
tcp 0 0 localhost.domain *.* LISTEN
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
udp 0 0 localhost.biff *.*
udp 0 0 *.38532 *.*
udp 0 0 LAXBCASTDNS01.domain *.*
udp 0 0 localhost.domain *.*
udp 0 0 *.syslog *.*
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp6 0 0 *.ssh *.* LISTEN
tcp6 0 0 *.submissi *.* LISTEN
tcp6 0 0 *.smtp *.* LISTEN
tcp6 0 0 *.time *.* LISTEN
tcp6 0 0 *.daytime *.* LISTEN
tcp6 0 0 *.auth *.* LISTEN
tcp6 0 0 localhost.953 *.* LISTEN
tcp6 0 0 *.domain *.* LISTEN
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
udp6 0 0 localhost.biff *.*
udp6 0 0 *.31202 *.*
udp6 0 0 *.domain *.*
Active UNIX domain sockets
Address Type Recv-Q Send-Q Inode Conn Refs Nextref Addr
0x6b6d648 dgram 0 0 0x0 0xe0e19040 0x0 0xe0e560c0
0x6b6dd50 stream 0 0 0x6a1d020 0x0 0x0 0x0 tabs/.sock
0x6b6dc88 dgram 0 0 0x0 0xe0e19040 0x0 0xe0e56040
0x80c0330 stream 0 0 0x6a2d580 0x0 0x0 0x0 /tmp/ssh-RxCmax5109/agent.5109
0x80c00d8 stream 0 0 0x6a29e10 0x0 0x0 0x0 /tmp/ssh-SjTMS25447/agent.25447
0x80c0010 stream 0 0 0x0 0xe0e6c880 0x0 0x0
0x6b6de18 stream 0 0 0x0 0xe0e6c840 0x0 0x0
0x60367d0 dgram 0 0 0x0 0xe0e19040 0x0 0xe0e4dd00
0x6036640 stream 0 0 0x0 0xe0e4d840 0x0 0x0
0x6036578 stream 0 0 0x0 0xe0e4da80 0x0 0x0
0x60364b0 dgram 0 0 0x0 0xe0e19040 0x0 0x0
0x60363e8 stream 0 0 0x0 0xe0e4d3c0 0x0 0x0
0x6036320 stream 0 0 0x0 0xe0e19400 0x0 0x0
0x6036258 dgram 0 0 0x6559a60 0x0 0x0 0x0 /var/empty/dev/log
0x6036190 dgram 0 0 0x6559998 0x0 0x0 0x0 /var/named/dev/log
0x60360c8 dgram 0 0 0x65598d0 0x0 0xe0e56c00 0x0 /dev/log
#
 
Old 08-25-2007, 03:20 PM   #5
Marv Bon
LQ Newbie
 
Registered: Aug 2007
Posts: 18

Original Poster
Rep: Reputation: 0
Thanks
Nbomr and acid_kewpie for your reply I posted the netstat command and as you can see UDP is not Listening.
 
Old 08-25-2007, 03:48 PM   #6
almatic
Member
 
Registered: Mar 2007
Distribution: Debian
Posts: 547

Rep: Reputation: 67
Quote:
as you can see UDP is not Listening.
and what's that ?

udp 0 0 *.syslog *.*

do 'lsof -i UDP:syslog'. It should show that syslogd is up and running correctly. You just need to tell your cisco stuff to send syslog info to your machine, choose a facility and point that facility to a logfile (in syslog.conf). If could be that you need to enable remote-logging, which is system-dependent I think (for debian it's in /etc/default/syslogd, don't know how to do it in bsd).
 
Old 08-26-2007, 11:07 AM   #7
Marv Bon
LQ Newbie
 
Registered: Aug 2007
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by almatic View Post
and what's that ?

udp 0 0 *.syslog *.*

do 'lsof -i UDP:syslog'. It should show that syslogd is up and running correctly. You just need to tell your cisco stuff to send syslog info to your machine, choose a facility and point that facility to a logfile (in syslog.conf). If could be that you need to enable remote-logging, which is system-dependent I think (for debian it's in /etc/default/syslogd, don't know how to do it in bsd).

This is what I get with lsof: not found.
 
Old 08-26-2007, 12:23 PM   #8
almatic
Member
 
Registered: Mar 2007
Distribution: Debian
Posts: 547

Rep: Reputation: 67
then maybe lsof is not installed. Try 'pgrep syslogd' or 'ps -A | grep syslogd' instead to verify that syslogd is running. The point is, that your problem is the configuration of syslogd, not the configuration of the network.

You are maybe irritated, that the udp lines in your output don't show the explicit 'LISTEN' but that's correct, it's not an error. udp does not know connection states such as listen or established, in fact it doesn't even use a connection. It's a fire-and-forget protocol, an application will send data and doesn't care if the receiver actually received them.
So you needn't (and can't) set udp ports to 'listen', all you need to do is configure syslogd.
 
Old 08-26-2007, 07:19 PM   #9
Marv Bon
LQ Newbie
 
Registered: Aug 2007
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by almatic View Post
then maybe lsof is not installed. Try 'pgrep syslogd' or 'ps -A | grep syslogd' instead to verify that syslogd is running. The point is, that your problem is the configuration of syslogd, not the configuration of the network.

You are maybe irritated, that the udp lines in your output don't show the explicit 'LISTEN' but that's correct, it's not an error. udp does not know connection states such as listen or established, in fact it doesn't even use a connection. It's a fire-and-forget protocol, an application will send data and doesn't care if the receiver actually received them.
So you needn't (and can't) set udp ports to 'listen', all you need to do is configure syslogd.
Almatic

Thanks for your professinals advice. This is what I get from ps -a | grep syslogd

22960 p0 I+ 0:00.00 grep syslogd
 
Old 08-28-2007, 01:04 PM   #10
almatic
Member
 
Registered: Mar 2007
Distribution: Debian
Posts: 547

Rep: Reputation: 67
you need to use capital A (ps -A, not ps -a). Probably that was your problem with lsof as well (capital UDP).
But I guess you have figured that out yourself in the meanwhile ...
 
Old 08-29-2007, 12:50 PM   #11
Marv Bon
LQ Newbie
 
Registered: Aug 2007
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by almatic View Post
you need to use capital A (ps -A, not ps -a). Probably that was your problem with lsof as well (capital UDP).
But I guess you have figured that out yourself in the meanwhile ...
I tried with -A. The result is not Found but "pgrep syslogd" is giving me this two numbers 13746 and 25622. Please explain this results

Last edited by Marv Bon; 08-29-2007 at 12:55 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Could not listen on UDP socket: address is in use. Marv Bon *BSD 1 08-26-2007 01:11 PM
Why server socket listen() is not listening seungtaeh Linux - Networking 1 03-09-2007 04:32 AM
Poll() and UDP socket krizzz Programming 4 06-06-2006 10:55 AM
could not listen on UDP socket: address in use peaceofcrap2001 Linux - Networking 2 07-10-2004 12:18 PM
How to receive UDP and ICMP packets, by one UDP socket(PMTUD) myself_rajat Linux - Networking 0 05-28-2004 05:43 AM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 08:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration