Unit lfd.service entered failed state lfd.service failed

Tác giả NetworkEngineer, T.M.Một 01, 2021, 09:59:28 CHIỀU

« Chủ đề trước - Chủ đề tiếp »

0 Thành viên và 1 Khách đang xem chủ đề.

Unit lfd.service entered failed state lfd.service failed


1. Triệu chứng.

Khi kiểm tra dịch vụ LFD bằng lệnh systemctl, bạn sẽ thấy lỗi này:

Mã nguồn [Chọn]
$ systemctl status lfd.service
Mã nguồn [Chọn]
lfd.service - ConfigServer Firewall & Security - lfd
  Loaded: loaded (/usr/lib/systemd/system/lfd.service; enabled; vendor preset: disabled)
  Active: failed (Result: exit-code) since Tue 2020-12-01 20:54:11 IST; 10min ago
  Process: 11119 ExecStart=/usr/sbin/lfd (code=exited, status=1/FAILURE)

Dec 01 20:54:10 host.domain.tld systemd[1]: Starting ConfigServer Firewall & Security - lfd...
Dec 01 20:54:11 host.domain.tld lfd[11119]: Error: You have an unresolved error when starting csf. You need to restart csf successfully before starting lfd (s...csf.error)
Dec 01 20:54:11 host.domain.tld systemd[1]: lfd.service: control process exited, code=exited status=1
Dec 01 20:54:11 host.domain.tld systemd[1]: Failed to start ConfigServer Firewall & Security - lfd.
Dec 01 20:54:11 host.domain.tld systemd[1]: Unit lfd.service entered failed state.
Dec 01 20:54:11 host.domain.tld systemd[1]: lfd.service failed.

Lỗi chỉ ra rằng bạn cần khởi động lại dịch vụ CSF trước khi có thể khởi động dịch vụ LFD. Tuy nhiên, khi bạn kiểm tra dịch vụ CSF, bạn nhận thấy rằng dịch vụ cũng không khởi động thành công với lỗi sau:

Mã nguồn [Chọn]
$ systemctl status csf.service -l
Mã nguồn [Chọn]
csf.service - ConfigServer Firewall & Security - csf
  Loaded: loaded (/usr/lib/systemd/system/csf.service; enabled; vendor preset: disabled)
  Active: failed (Result: exit-code) since Mon 2020-11-30 20:13:09 IST; 24h ago
 Main PID: 943 (code=exited, status=1/FAILURE)

Nov 30 20:12:56 host.domain.tld systemd[1]: Starting ConfigServer Firewall & Security - csf...
Nov 30 20:13:09 host.domain.tld csf[943]: You have an unresolved error when starting csf:
Nov 30 20:13:09 host.domain.tld csf[943]: Error: FASTSTART: (Packet Filter IPv4) [] [iptables-restore: line 14 failed]. Try restarting csf with FASTSTART disabled, at line 5584 in /usr/sbin/csf
Nov 30 20:13:09 host.domain.tld csf[943]: You need to restart csf successfully to remove this warning, or delete /etc/csf/csf.error
Nov 30 20:13:09 host.domain.tld systemd[1]: csf.service: main process exited, code=exited, status=1/FAILURE
Nov 30 20:13:09 host.domain.tld systemd[1]: Failed to start ConfigServer Firewall & Security - csf.
Nov 30 20:13:09 host.domain.tld systemd[1]: Unit csf.service entered failed state.
Nov 30 20:13:09 host.domain.tld systemd[1]: csf.service failed.

2. Giải thích.

Vấn đề liên quan đến tùy chọn FASTSTART được bật trong tập tin cấu hình của tường lửa CSF /etc/csf/csf.conf, bạn có thể xác nhận tùy chọn này bằng cách chạy lệnh sau:

Mã nguồn [Chọn]
$ grep -ir 'FASTSTART = "1"' /etc/csf/*
Mã nguồn [Chọn]
/etc/csf/csf.conf:FASTSTART = "1"
Tùy chọn này không được hỗ trợ trên tất cả các hệ điều hành, Dưới đây bạn sẽ tìm thấy một mô tả ngắn về chức năng của tùy chọn này:

Mã nguồn [Chọn]
# This option uses IPTABLES_SAVE, IPTABLES_RESTORE and IP6TABLES_SAVE,
# IP6TABLES_RESTORE in two ways:
#
# 1. On a clean server reboot the entire csf iptables configuration is saved
# and then restored where possible to provide a near instant firewall
# startup[*]
#
# 2. On csf restart or lfd reloading tables, CC_* as well as SPAMHAUS, DSHIELD,
# BOGON, TOR are loaded using this method in a fraction of the time than if
# this setting is disabled
#
# [*]Not supported on all OS platforms

3. Cách giải quyết.

Chỉnh sửa tập tin cấu hình chính của CSF tại /etc/csf/csf.conf và tắt FASTSTART bằng cách chỉnh sửa FASTSTART = "1" thành FASTSTART = "0".

Sau khi thay đổi được thực hiện, hãy khởi động lại các quy tắc của CSF bằng cách chạy lệnh sau:

Mã nguồn [Chọn]
$ csf -r
Sau đó, hãy kiểm tra cả hai dịch vụ và nếu bất kỳ dịch vụ nào trong số chúng chưa khởi động tự động, bây giờ bạn có thể khởi động lại chúng theo cách thủ công bằng cách sử dụng lệnh systemctl như sau:

Mã nguồn [Chọn]
$ systemctl start csf.service
Mã nguồn [Chọn]
$ systemctl start lfd.service