Issues With Memcached When Running With Socket

Dradden45

Active Member
Sep 7, 2012
37
2
8
cPanel Access Level
Root Administrator
I have been working on getting Railgun up and running which requires memcached. I have memcached installed and running and it works fine when running and listening on port. But when changing things up and trying to get it to use a socket it does not want to co-operate.

It seems like it starts up and runs ok, service memcached status is fine. But when trying to start Railgun I notice it fails because it cannot connect to Memcached.

I have memcached configured to create memcached.sock in /tmp but after starting memcached I notice the file is not present.

Here is memcached conf:

#PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="512"
OPTIONS=""
-s /tmp/memcached.sock
-a 0666

I have tried setting the -a option to elevated permissions all the way up to 0777 but still no luck. I do run CageFS but have moved the memcached user so he is not restricted and updated CageFS. I cannot find anything in the logs as to why the memcached.sock file is not created. /tmp I increased in size also today up to 3GB.

So looking for some help on this one :)
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,211
363
It seems like it starts up and runs ok, service memcached status is fine. But when trying to start Railgun I notice it fails because it cannot connect to Memcached.
Hello :)

Could you paste the specific failure message?

Thank you.
 

Dradden45

Active Member
Sep 7, 2012
37
2
8
cPanel Access Level
Root Administrator
Hi :)

Yeah that would help :P

Code:
Starting railgun (via systemctl):  Job for railgun.service failed because a configured resource limit was exceeded. See "systemctl status railgun.service" and "journalctl -xe" for details.
Railgun successfully backgrounded, ensuring proper startup...
[FAILED]
Error starting Railgun as a daemon. Running in foreground...
su (to railgun) root on none
Error starting: Error connecting to memcached server /tmp/memcached.sock: dial unix /tmp/memcached.sock: no such file or directory
[FAILED]
PID 572965 read from file /var/run/railgun/railgun.pid does not exist or is a zombie.
Failed to start LSB: Railgun listener.
Unit railgun.service entered failed state.
railgun.service failed.

Code:
[email protected] [~]# service memcached status
Redirecting to /bin/systemctl status  memcached.service
● memcached.service - Memcached
   Loaded: loaded (/usr/lib/systemd/system/memcached.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2016-02-11 21:03:56 EST; 4min 21s ago
Main PID: 572604 (memcached)
   CGroup: /system.slice/memcached.service
           └─572604 /usr/bin/memcached -u memcached -p -m 512 -c 1024

There is no /tmp/memcached.sock

memcached config

Code:
#PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="512"
OPTIONS=""
-s /tmp/memcached.sock
-a 0777
 

Dradden45

Active Member
Sep 7, 2012
37
2
8
cPanel Access Level
Root Administrator
Hi Michael,

Code:
yum install memcached.x86_64 php-pecl-memcache.x86_64
Than I tried to add through Software > Module Installers > PHP Pecl

It complained about:

Code:
checking for libmemcached location... configure: error: memcached support requires libmemcached. Use --with-libmemcached-dir= to specify the prefix where libmemcached headers and library are located
ERROR: `/root/tmp/pear/memcached/configure --with-php-config=/usr/local/bin/php-config --with-libmemcached-dir=no' failed
The memcached.so object is not in /usr/local/lib/php/extensions/no-debug-non-zts-20131226
So I did:

Code:
yum install cyrus-sasl-devel
cd ~
wget http://launchpad.net/libmemcached/1.0/1.0.4/+download/libmemcached-1.0.4.tar.gz
tar -zxvf libmemcached-1.0.4.tar.gz
cd libmemcached-1.0.4
./configure
make && make install
pecl install memcached
That still didn't get it going I had to again rebuild through Software > Module Installers > PECL > Memcached

After that everything for the most part worked fine as long as using port instead of socket. i did actually have it working on socket but than I resized /tmp and ever since than I get the behavior I posted about.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,211
363
i did actually have it working on socket but than I resized /tmp and ever since than I get the behavior I posted about.
Have you tried reverting your /tmp partition to it's original state? Also, what are the current permissions and mount options for your /tmp partition?

Thank you.
 

Dradden45

Active Member
Sep 7, 2012
37
2
8
cPanel Access Level
Root Administrator
Out of the blue working now, no idea why now it works nothing changed. Will have to see if it persists after the next reboot. Thanks for the help.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,211
363
I am happy to see it's now working well. Thank you for updating us with the outcome.