Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 309795 - net-misc/memcached: listenon doesn't work as expected
Summary: net-misc/memcached: listenon doesn't work as expected
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-16 15:48 UTC by Matthias Siedler
Modified: 2010-03-25 21:12 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Siedler 2010-03-16 15:48:17 UTC
I have configured to run memcached on my internal IP address on eth1.
/etc/conf.d/memcached:
LISTENON="192.168.230.80"

In the process list it is started as it should:
/usr/bin/memcached -d -p 11211 -U -l 192.168.230.80 -m 64 -c 1024 -u memcached -P /var/run/memcached/memcached-11211.pid

But I still can connect on my external interface on eth0!

Reproducible: Always

Steps to Reproduce:
Comment 1 Matthias Siedler 2010-03-16 15:51:26 UTC
tried with memcached v1.4.1 (stable) as well as v1.4.4
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-03-24 22:00:16 UTC
1. please show me the output of netstat -anp with your memcached running.
2. how are you connecting to test?
Comment 3 Matthias Siedler 2010-03-25 08:30:02 UTC
Here you go:

# netstat -anp|grep memcache
tcp        0      0 0.0.0.0:11211           0.0.0.0:*               LISTEN      25341/memcached
unix  3      [ ]         STREAM     CONNECTED     608130469 25341/memcached
unix  3      [ ]         STREAM     CONNECTED     608130468 25341/memcached
unix  3      [ ]         STREAM     CONNECTED     608130465 25341/memcached
unix  3      [ ]         STREAM     CONNECTED     608130464 25341/memcached
unix  3      [ ]         STREAM     CONNECTED     608130461 25341/memcached
unix  3      [ ]         STREAM     CONNECTED     608130460 25341/memcached
unix  3      [ ]         STREAM     CONNECTED     608130457 25341/memcached
unix  3      [ ]         STREAM     CONNECTED     608130456 25341/memcached
unix  3      [ ]         STREAM     CONNECTED     608130453 25341/memcached
unix  3      [ ]         STREAM     CONNECTED     608130452 25341/memcached


I'm doing a telnet from an other computer to the external interface of the server / IP:

# telnet xx.xx.xx.xx 11211
Trying xx.xx.xx.xx...
Connected to xx.xx.xx.xx.
Escape character is '^]'.
stats
STAT pid 25341
STAT uptime 209
STAT time 1269505752
STAT version 1.4.4
STAT pointer_size 32
...
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-03-25 18:19:53 UTC
are you sure that memcached is the same one you're starting?
you're passing -U so there should be a udp listening port too.
I'm wondering if you have a stale copy that's running and openrc doesn't know about it.

# ps -ef |grep memcached
113       2208     1  0 11:15 ?        00:00:00 /usr/bin/memcached -d -p 11211 -U 11211 -l 172.16.9.8 -m 64 -c 1024 -u memcached -P /var/run/memcached/memcached-11211.pid
root      6236 26985  0 11:16 pts/8    00:00:00 grep --colour=auto memcached
# netstat -anp |grep memcached |egrep -v 'CONNECTED|ESTAB'
tcp        0      0 172.16.9.8:11211        0.0.0.0:*               LISTEN      2208/memcached      
udp        0      0 172.16.9.8:11211        0.0.0.0:*                           2208/memcached      
Comment 5 Matthias Siedler 2010-03-25 21:02:17 UTC
Thanks, that was a good hint. It seams like the port for the -U parameter is missing (thus it is taking the -l as the value for that parameter).

And I found the reason for that: I upgraded from an older version, but the /etc/conf.d/memcached wasn't updated. In the new version an additional option is available:
# Listen for UDP connecitons on what port? 0 means turn off UDP
UDPPORT="${PORT}"
Once I have added that, the process is started as expected:

/usr/bin/memcached -d -p 11211 -U 11211 -l 192.168.xx.xx -m 64 -c 1024 -u memcached -P /var/run/memcached/memcached-11211.pid

And now memcached is binding to the internal interface only.

Solved. Thanks a lot!!!
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-03-25 21:12:50 UTC
good to see it's not broken :-)