Summary: | net-misc/memcached: support listening on socket | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Johan Bergström <bugs> |
Component: | [OLD] Server | Assignee: | Robin Johnson <robbat2> |
Status: | CONFIRMED --- | ||
Severity: | enhancement | CC: | kfm, me |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=525412 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
init
conf PORT=unix |
Created attachment 279223 [details]
conf
Possible caveats: - socket path uses ${PORT} - no reason to let users define socket path? a possible reason would be to leave LISTENON blank, and thereby "enabling" socket? Created attachment 322810 [details, diff]
PORT=unix
conf PORT=unix patch
*** Bug 477398 has been marked as a duplicate of this bug. *** Currently you can pass socket path as misc option. The script will incorrectly complain that memcached would listen on 0.0.0.0 though. (In reply to Michał Górny from comment #5) > Currently you can pass socket path as misc option. The script will > incorrectly complain that memcached would listen on 0.0.0.0 though. Figured out today that setting LISTENON and PORT both to 0, the complaint would go away. mind trying 1.4.24/25? |
Created attachment 279221 [details] init If you're using memcached locally there isn't much reason to use TCP. memcached -s will do this for you. Attaching my futile (yes, its really futile) attempt at toggling socket/tcp through conf.d/init.d. Here's the diff : --- /usr/portage/net-misc/memcached/files/1.3.3/init 2009-05-26 02:03:09.000000000 +0200 +++ /etc/init.d/memcached 2011-04-20 09:36:53.000000000 +0200 @@ -32,7 +32,6 @@ ewarn "You should edit $CONFSRC and specify an address to listen on." ewarn "Listening on any address (check your firewall!)" fi - } start() { @@ -54,15 +53,17 @@ fi if [ -z "${LISTENON}" ]; then - c_LISTENON="" + c_LISTENON="-p ${PORT}" + elif [ "${LISTENON:0:1}" == "/" ]; then + c_LISTENON="-s ${LISTENON}" else - c_LISTENON="-l ${LISTENON}" + c_LISTENON="-l ${LISTENON} -U ${UDPPORT} -p ${PORT}" fi /sbin/start-stop-daemon --start --pidfile "${PIDFILE}" \ --exec "${MEMCACHED_BINARY}" \ --startas "${MEMCACHED_BINARY}" -- \ - -d -p ${PORT} -U ${UDPPORT} ${c_LISTENON} -m ${MEMUSAGE} \ + -d ${c_LISTENON} -m ${MEMUSAGE} \ -c ${MAXCONN} -u ${MEMCACHED_RUNAS} -P "${PIDFILE}" \ ${MISC_OPTS} eend $? --- /usr/portage/net-misc/memcached/files/1.3.3/conf 2009-05-26 02:03:09.000000000 +0200 +++ /etc/conf.d/memcached 2011-05-09 07:58:01.000000000 +0200 @@ -4,9 +4,14 @@ MEMCACHED_BINARY="/usr/bin/memcached" +#PID file location +# '-${PORT}.${CONF}.pid' will be appended to this! +# You do not normally need to change this. +PIDBASE="/var/run/memcached/memcached" + #Specify memory usage in megabytes (do not use letters) #64MB is default MEMUSAGE="64" @@ -15,10 +20,13 @@ #1024 is default MAXCONN="1024" -#Listen for connections on what address? +# Listen for connections on what address? # If this is empty, memcached will listen on 0.0.0.0 # be sure you have a firewall in place! -LISTENON="" +# Should you enter a path, memcached will listen on socket instead. +# The recommended directory for sockets is the same as ${PIDBASE} +# Note: This disables TCP/UDP altogether +LISTENON="${PIDBASE}.sock" #Listen for connections on what port? PORT="11211" @@ -26,10 +34,5 @@ # Listen for UDP connecitons on what port? 0 means turn off UDP UDPPORT="${PORT}" -#PID file location -# '-${PORT}.${CONF}.pid' will be appended to this! -# You do not normally need to change this. -PIDBASE="/var/run/memcached/memcached" - #Other Options MISC_OPTS=""