Run APM in local

Hi there,

i keep getting this message while trying to run apm server on my local. what could possibly the cause?

May 27 17:39:15 polos systemd[3041]: apm-server.service: Failed to execute command: Permission denied
May 27 17:39:15 polos systemd[3041]: apm-server.service: Failed at step EXEC spawning /apm-server/apm-server/apm-server-7.17.18-linux-x86_64/apm-server: Permission denied
May 27 17:39:15 polos systemd[1]: apm-server.service: Main process exited, code=exited, status=203/EXEC

I installed it by using .tar.gz installation and the ownership of the config file (apm-server.yml) is 600. owned by root

and this is how my systemd looks like

[Unit]
Description=APM Service

[Service]
Type=simple
ExecStart=/apm-server/apm-server/apm-server-7.17.18-linux-x86_64/apm-server
WorkingDirectory=/apm-server/apm-server/apm-server-7.17.18-linux-x86_64
Restart=on-failure
RestartSec=5s

# Specifies the maximum size of virtual memory
LimitAS=infinity

# Specifies the maximum file size
LimitFSIZE=infinity

# Disable timeout logic and wait until process is stopped
TimeoutStopSec=0

# SIGTERM signal is used to stop the Java process
KillSignal=SIGTERM

# Send the signal only to the JVM rather than its control group
KillMode=process

# Java process is never killed
SendSIGKILL=no

# When a JVM receives a SIGTERM signal it exits with code 143
SuccessExitStatus=143

[Install]
WantedBy=multi-user.target

and this what my files looks like
image

even the binary itself was owned by root. and it still gives me the same error message.

it's working if I run it by using ./apm-server -e

so I think the problem is in systems but idk where exactly. can you help me with this?
Thanks

finally, i found a solution for this.

my SELinux is active, so I labeled apm's binary to bint_t

semanage fcontext -a -t bin_t "/apm/apm-server-8.18.2-linux-x86_64/apm-server"
restorecon -v /apm/apm-server-8.18.2-linux-x86_64/apm-server

That way, apm service can be running normally. But I still don't understand why this happens. elasticsearch on the same machine with the same label before unlabeled_t can run without any disruption. i even make APMs' systemd look exactly the same as Elastic. i just changed the path but it still didn't work