1
2
3
4
5
6
7
8
9
post_install(){
   useradd -r -g daemon -d /usr/share/elasticsearch -s /bin/false elasticsearch
   chown -R elasticsearch:daemon /var/lib/elasticsearch
   chown -R elasticsearch:daemon /var/log/elasticsearch
}

post_remove(){
  userdel elasticsearch
}