Centos, how to install to run as unprivileged user?


When I install filebeat via yum install ./filebeat-7.4.2-x86_64.rpm the service is running as root.
In the past I always edited /usr/lib/systemd/system/filebeat.service adding


in [Service] section.

Is there any way to give the installation process the target user and group which should run filebeat service? It's a nasty post install/update task I want to get rid of because it is always trouble if we forget it.

Thanks, Andreas