as in Summary. elasticsearch has DATA_DIR specified in /etc/conf.d/elasticsearch, which is ignored if uncommented and set to other place. It keeps write data into /var/lib/elasticsearch Reproducible: Always Steps to Reproduce: 1. mkdir -m 0777 /home/oleg/elasticsearch 2. modify /etc/conf.d/elasticsearch to use DATA_DIR=/home/oleg/elasticsearch 3. rc-update add elasticsearch default 4. rc 5. notice that no data is in /home/oleg/elasticsearch ever created 6. notice that /var/lib/elasticsearch data created and used.
actual problem is in /etc/init.d/elasticsearch DATA_DIR="${ES_BASE_PATH}/data"
Created attachment 452384 [details, diff] patch
https://github.com/gentoo/gentoo/pull/3158
Should work with 5.1.1, please give it a try.