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:
tried with memcached v1.4.1 (stable) as well as v1.4.4
1. please show me the output of netstat -anp with your memcached running. 2. how are you connecting to test?
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 ...
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
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!!!
good to see it's not broken :-)