zot24
3/22/2016 - 2:25 PM

install memcached from source with supervisord

install memcached from source with supervisord

[program:memcached]
command=/usr/local/bin/memcached -p 11211 -u memcached -m 256 -c 1024 -t 4
autostart=true
autorestart=true
user=root
priority=100
redirect_stderr=true
stdout_logfile=/var/log/memcached/stdout.log
#!/bin/sh

version="1.4.15"
priority="10415"
libevent="/usr/local/libevent/2.0.20-stable/"
supervisordir="/etc/supervisord.d"

# create user
sudo groupadd memcached
sudo useradd -r -g memcached -s /sbin/nologin -M -d /var/run/memcached memcached

# download and install
curl -sL http://memcached.googlecode.com/files/memcached-${version}.tar.gz | tar zx
cd memcached-${version}/
ll
./configure --prefix=/usr/local/memcached/${version} --enable-64bit --with-libevent=${libevent}
make
sudo make install
cd ../
sudo alternatives --install /usr/local/bin/memcached memcached /usr/local/memcached/${version}/bin/memcached ${priority}
sudo cp ./memcached.ini $supervisordir/memcached.ini
sudo supervisorctl reread
sudo supervisorctl add memcached