Giải quyết lỗi theo dõi quá trình biến mất theo dõi quá trình khởi động Monit. Dịch vụ không thành công.

Phần mềm giám sát Monit không khởi động được quá trình giám sát.

Giải quyết lỗi theo dõi quá trình biến mất theo dõi quá trình khởi động Monit. Dịch vụ không thành công.

Monit bắt đầu quá trình giám sát và biến mất, nhắc monit.service faiđã dẫn.

Sau khi cài đặt phần mềm giám sát Monit trong bảng điều khiển CWP (CWP7) , tiến trình giám sát Monit biến mất và xuất hiện thông báo "monit.service failed".

Cần lưu ý rằng một nỗ lực đã được thực hiện để kích hoạtsystemctl enable monit

[root@stage-web-1 vagrant]# systemctl status monit
monit.service - Pro-active monitoring utility for unix systems
Loaded: loaded (/usr/lib/systemd/system/monit.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2017-06-01 16:37:00 UTC; 6min ago
Process: 1131 ExecStop=/usr/bin/monit quit (code=exited, status=1/FAILURE)
Process: 1079 ExecStart=/usr/bin/monit -I (code=exited, status=1/FAILURE)
Main PID: 1079 (code=exited, status=1/FAILURE)

Jun 01 16:37:00 stage-web-1 systemd[1]: Started Pro-active monitoring utility for unix systems.
Jun 01 16:37:00 stage-web-1 systemd[1]: Starting Pro-active monitoring utility for unix systems...
Jun 01 16:37:00 stage-web-1 monit[1079]: Error opening the log file '/var/www/html/nfs/monit/stage-web-1.log' for writing -- No such file or directory
Jun 01 16:37:00 stage-web-1 systemd[1]: monit.service: main process exited, code=exited, status=1/FAILURE
Jun 01 16:37:00 stage-web-1 monit[1131]: Error opening the log file '/var/www/html/nfs/monit/stage-web-1.log' for writing -- No such file or directory
Jun 01 16:37:00 stage-web-1 systemd[1]: monit.service: control process exited, code=exited status=1
Jun 01 16:37:00 stage-web-1 systemd[1]: Unit monit.service entered failed state.
Jun 01 16:37:00 stage-web-1 systemd[1]: monit.service failed.

Sự thật cho thấy rằng nó/var/www/html/nfslà một thư mục được gắn vào ổ đĩa mạng qua NFS.

Monit đã được khởi động trước NFS, do đó, thư mục chưa tồn tại, gây ra lỗi theo dõiError opening the log file '/var/www/html/nfs/monit/stage-web-1.log' for writing -- No such file or directory.

Làm thế nào để giải quyết sự biến mất của giám sát quá trình khởi động Monit. Dịch vụ không thành công.?

Cách giải quyết là chỉnh sửa/lib/systemd/system/monit.service:

[Unit]
Description=Pro-active monitoring utility for unix systems
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/monit -I
ExecStop=/usr/bin/monit quit
ExecReload=/usr/bin/monit reload

[Install]
WantedBy=multi-user.target

và thêmnfs.serviceđếnAfterPhía sau.Kết quả cuối cùng trông như thế này:

[Unit]
Description=Pro-active monitoring utility for unix systems
After=network.target nfs.service

[Service]
Type=simple
ExecStart=/usr/bin/monit -I
ExecStop=/usr/bin/monit quit
ExecReload=/usr/bin/monit reload

[Install]
WantedBy=multi-user.target

Màn hình Monit bây giờ có thể khởi động thành công tại thời điểm khởi động.

Hi vọng bài viết "Khắc phục lỗi tiến trình giám sát Monit biến mất khi khởi động: monit.service failed." được chia sẻ trên blog của Chen Weiliang ( https://www.chenweiliang.com/ ) sẽ hữu ích cho bạn.

Bạn có thể thoải mái chia sẻ liên kết bài viết này: https://www.chenweiliang.com/cwl-1422.html

Để khám phá thêm nhiều mẹo ẩn🔑, vui lòng tham gia kênh Telegram của chúng tôi!

Chia sẻ và thích nếu bạn thích nó! Những chia sẻ và lượt thích của bạn là động lực tiếp tục của chúng tôi!

 

发表 评论

您的邮箱地址不会被公开。必填项已用*标注

Di chuyển về đầu trang