Making sure that memcache/memcached auto start

faca5

Registered
Nov 25, 2010
2
0
51
Hello.

Do you have any idea how to make memcache/d auto start if fail to work?!

I found these instructions.

It doesnt work very well on UDP port.


CentOS 5 and 6

/etc/chkserv.d/memcached

service[memcached]=11211,version,VERSION,/etc/init.d/memcached restart,memcached,memcached


/scripts/restartsrv_memcached
#!/bin/bash
/etc/init.d/memcached restart

chmod +x /scripts/restartsrv_memcached




CentOS 7

/etc/chkserv.d/memcached
service[memcached]=11211,version,VERSION,/bin/systemctl restart memcached,memcached,memcached


/scripts/restartsrv_memcached
#!/bin/bash
/bin/systemctl restart memcached

chmod +x /scripts/restartsrv_memcached



Enable
WHM > Service Manager > Memcached
/etc/chkserv.d/chkservd.conf
 

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
8,012
648
263
Houston
cPanel Access Level
DataCenter Provider
Hello @faca5

Where did you get those instructions? Those appear to be instructions on how to add it to chkservd. If executed properly they should work

Can you take a look at the thread and the ones linked within it here: Installing memcache and memcached with EasyApache4
How to install Memcached in EA4 and PHP72

And let me know if these help with the issue. The following works to start/restart though I had to add it as follows:

Code:
systemctl enable memcached.service
Created symlink from /etc/systemd/system/multi-user.target.wants/memcached.service to /usr/lib/systemd/system/memcached.service.
Code:
# systemctl start memcached.service
# systemctl status memcached.service
● memcached.service - Memcached
   Loaded: loaded (/usr/lib/systemd/system/memcached.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2018-09-18 11:35:31 CDT; 1s ago
 Main PID: 28208 (memcached)
   CGroup: /system.slice/memcached.service
           └─28208 /usr/bin/memcached -u memcached -p 11211 -m 64 -c 1024 -l 127.0.0.1,::1

Create this file:
Code:
/etc/chkserv.d/memcached
Which has the contents as follows
Code:
service[memcached]=11211,version,VERSION,/bin/systemctl restart memcached,memcached,memcached
Create this file:
Code:
/scripts/restartsrv_memcached
Which has the contents as follows:
Code:
/bin/systemctl restart memcached
Then run:
Code:
chmod +x /scripts/restartsrv_memcached
This makes