Answer the question
In order to leave comments, you need to log in
Permissions to run systemd service for selinux?
I'm trying to make consul.service run like this :
[Unit]
Description=Consul service discovery agent
Requires=network-online.target
After=network.target
[Service]
User=consul
Group=consul
PIDFile=/run/consul.pid
Restart=on-failure
Environment=GOMAXPROCS=2
ExecStart=/usr/local/bin/consul agent $OPTIONS -config-dir=/etc/consul.d
ExecReload=/bin/kill -s HUP $MAINPID
KillSignal=SIGINT
TimeoutStopSec=5
[Install]
WantedBy=multi-user.target
Oct 17 10:20:06 consul1 systemd[16572]: consul.service: Failed to execute command: Permission denied
Oct 17 10:20:06 consul1 systemd[16572]: consul.service: Failed at step EXEC spawning /usr/local/bin/consul: Permission denied
Oct 17 10:20:06 consul1 systemd[1]: consul.service: Main process exited, code=exited, status=203/EXEC
Oct 17 10:20:06 consul1 systemd[1]: consul.service: Failed with result 'exit-code'.
Oct 17 10:20:07 consul1 systemd[1]: consul.service: Service hold-off time over, scheduling restart.
Oct 17 10:20:07 consul1 systemd[1]: consul.service: Scheduled restart job, restart counter is at 4.
type=AVC msg=audit(1539778184.232:1302): avc: denied { execute } for pid=16884 comm="(consul)" name="consul" dev="vda1" ino=1019 scontext=system_u:system_r:init_t:s0 tcontext=unconfined_u:object_r:unconfined_exec_t:s0 tclass=file permissive=0
[[email protected] ~]# ls -Z /usr/bin/consul
system_u:object_r:bin_t:s0 /usr/bin/consul
[[email protected] ~]# ls -Z /tmp/consul
unconfined_u:object_r:user_tmp_t:s0 /tmp/consul
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question