Some time as sysadmin we face error [ALERT] 186/075705 (16762) : Could not open configuration file /etc/haproxy/haproxy.cfg : Permission denied on haproxy
Step 1: Set Selinux permissive to haproxy
Completely haproxy error status
[maswachid@localhost ~]$ sudo service haproxy status
[sudo] password for yudha:
Redirecting to /bin/systemctl status haproxy.service
● haproxy.service - HAProxy Load Balancer
Loaded: loaded (/usr/lib/systemd/system/haproxy.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2018-07-06 07:57:05 WIB; 1min 26s ago
Process: 16761 ExecStart=/usr/sbin/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid $OPTIONS (code=exited, status=1/FAILURE)
Main PID: 16761 (code=exited, status=1/FAILURE)
Jul 06 07:57:05 localhost.localdomain systemd[1]: Started HAProxy Load Balancer.
Jul 06 07:57:05 localhost.localdomain systemd[1]: Starting HAProxy Load Balancer...
Jul 06 07:57:05 localhost.localdomain haproxy-systemd-wrapper[16761]: haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/hap....pid -Ds
Jul 06 07:57:05 localhost.localdomain haproxy-systemd-wrapper[16761]: [ALERT] 186/075705 (16762) : Could not open configuration file /etc/haproxy/haproxy.cfg : Pe...n denied
Jul 06 07:57:05 localhost.localdomain haproxy-systemd-wrapper[16761]: haproxy-systemd-wrapper: exit, haproxy RC=1
Jul 06 07:57:05 localhost.localdomain systemd[1]: haproxy.service: main process exited, code=exited, status=1/FAILURE
Jul 06 07:57:05 localhost.localdomain systemd[1]: Unit haproxy.service entered failed state.
Jul 06 07:57:05 localhost.localdomain systemd[1]: haproxy.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
[maswachid@localhost ~]$
Set permissive to selinux by running following command
[maswachid@localhost ~]$ sudo semanage permissive -a haproxy_t
Step 2: Restart the haproxy and check the status
Restart and check haproxy status by running following command line
[maswachid@localhost ~]$ sudo service haproxy start
Redirecting to /bin/systemctl start haproxy.service
[yudha@localhost ~]$ sudo service haproxy status
Redirecting to /bin/systemctl status haproxy.service
● haproxy.service - HAProxy Load Balancer
Loaded: loaded (/usr/lib/systemd/system/haproxy.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2018-07-06 08:12:34 WIB; 3s ago
Main PID: 1018 (haproxy-systemd)
CGroup: /system.slice/haproxy.service
├─1018 /usr/sbin/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid
├─1019 /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
└─1020 /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
Jul 06 08:12:34 localhost.localdomain systemd[1]: Started HAProxy Load Balancer.
Jul 06 08:12:34 localhost.localdomain systemd[1]: Starting HAProxy Load Balancer...
Jul 06 08:12:34 localhost.localdomain haproxy-systemd-wrapper[1018]: haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
Hint: Some lines were ellipsized, use -l to show in full.
[maswachid@localhost ~]$
Tidak ada komentar :
Posting Komentar