Modernise memcached systemd unit / sync, and make it presentable
Open, In Progress, MediumPublic

Description

memcached currently runs as "nobody". Running services as nobody is an antipattern, since it allows one service running as nobody to run code with the same privileges as a different service running as nobody. The default unit in buster runs memcached as "memcached"

Also, memcached in buster ships a systemd-memcached-wrapper which simply points to /etc/memcached.conf, so it would also be an option to switch to that and possibly no longer customise the systemd unit at all.

  • update systemd related hacks/puppet code/whatever
  • ensure the service is run under the memcache user

The following roles/profiles need to be migrated to use memcached_user: 'memcache'

cloud

  • hieradata/cloud.yaml
  • hieradata/cloud/eqiad1/deployment-prep/common.yaml
  • hieradata/role/codfw/wmcs/openstack/codfw1dev/control.yaml
  • hieradata/role/eqiad/wmcs/openstack/eqiad1/control.yaml

idp

  • hieradata/role/common/idp_test.yaml
  • hieradata/common/profile/idp/memcached.yaml

rest

  • hieradata/common/profile/memcached.yaml (& role)

CCing cloud-services-team for the cloud related

Event Timeline

jijiki triaged this task as Medium priority.Feb 5 2021, 8:22 AM
jijiki added projects: User-jijiki, serviceops.

systemd-memcached-wrapper is a perl script, an evolution of the old wrapper script debian always used and that caused me more headaches than it solved. I'd very much prefer we keep the approach we took with our systemd unit back in the day (while it might make sense to switch to use user memcached for the reasons above)

jijiki renamed this task from Modernise memcached systemd unit / sync to current buster setup to Modernise memcached systemd unit / sync, and make it presentable.Apr 11 2024, 6:50 PM
jijiki updated the task description. (Show Details)

Change #1026609 had a related patch set uploaded (by Effie Mouzeli; author: Effie Mouzeli):

[operations/puppet@production] (WIP) memcached: make the service run under the memcache user

https://gerrit.wikimedia.org/r/1026609

Change #1032495 had a related patch set uploaded (by Effie Mouzeli; author: Effie Mouzeli):

[operations/puppet@production] memcached: run as user memcache on mc-gp2003

https://gerrit.wikimedia.org/r/1032495

Change #1026609 merged by Effie Mouzeli:

[operations/puppet@production] memcached: add memcached_user option

https://gerrit.wikimedia.org/r/1026609

Change #1032495 merged by Effie Mouzeli:

[operations/puppet@production] memcached: run as user memcache on mc-gp2003

https://gerrit.wikimedia.org/r/1032495

Change #1034839 had a related patch set uploaded (by Effie Mouzeli; author: Effie Mouzeli):

[operations/puppet@production] mediawiki::memcached: switch to running as user memcache

https://gerrit.wikimedia.org/r/1034839

Change #1035328 had a related patch set uploaded (by Effie Mouzeli; author: Effie Mouzeli):

[operations/puppet@production] mediawiki::memcached: switch to running as user memcache mcX050-mcX054

https://gerrit.wikimedia.org/r/1035328

Change #1035328 merged by Effie Mouzeli:

[operations/puppet@production] mediawiki::memcached: switch to running as user memcache mcX050-mcX054

https://gerrit.wikimedia.org/r/1035328

Change #1035349 had a related patch set uploaded (by Effie Mouzeli; author: Effie Mouzeli):

[operations/puppet@production] mediawiki::memcached: set number of memcached threads mcX050-mcX054

https://gerrit.wikimedia.org/r/1035349

Change #1035349 merged by Effie Mouzeli:

[operations/puppet@production] mediawiki::memcached: increase number of threads mcX050-mcX054

https://gerrit.wikimedia.org/r/1035349

jijiki changed the task status from Open to In Progress.May 24 2024, 11:49 AM
jijiki claimed this task.

Change #1034839 abandoned by Effie Mouzeli:

[operations/puppet@production] mediawiki::memcached: switch to running as user memcache

Reason:

already merged as I42325f5a906b5df37810b196b3e3cef67151cea3

https://gerrit.wikimedia.org/r/1034839

jijiki changed the task status from In Progress to Open.Jun 4 2024, 8:42 AM
jijiki added a project: Cloud-Services.
jijiki updated the task description. (Show Details)

The Cloud-Services project tag is not intended to have any tasks. Please check the list on https://phabricator.wikimedia.org/project/profile/832/ and replace it with a more specific project tag to this task. Thanks!

jijiki changed the task status from Open to In Progress.Jun 4 2024, 3:12 PM
jijiki updated the task description. (Show Details)

Change #1039206 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Configure memcached on idp-test hosts to run as 'memcache'

https://gerrit.wikimedia.org/r/1039206

Change #1039206 merged by Muehlenhoff:

[operations/puppet@production] Configure memcached on idp-test hosts to run as 'memcache'

https://gerrit.wikimedia.org/r/1039206

Change #1039226 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Fix Hiera option name

https://gerrit.wikimedia.org/r/1039226

Change #1039226 merged by Muehlenhoff:

[operations/puppet@production] Fix Hiera option name

https://gerrit.wikimedia.org/r/1039226

Change #1039229 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Configure memcached on idp hosts to run as 'memcache'

https://gerrit.wikimedia.org/r/1039229

CAS 7.0 (what we are currently migrating to) removed the memcached backend. As such, this change won't be needed anymore for the idp servers, I'll tick them off.

Change #1039229 abandoned by Muehlenhoff:

[operations/puppet@production] Configure memcached on idp hosts to run as 'memcache'

Reason:

CAS 7.0 removed the memcached backend, no longer needed

https://gerrit.wikimedia.org/r/1039229