ແກ້ໄຂຂະບວນການກວດສອບການເລີ່ມຕົ້ນ Monit ຫາຍໄປ monit.service ລົ້ມເຫລວ.

ຊອບແວ ຕິດຕາມກວດກາ Monit ລົ້ມເຫລວໃນການເລີ່ມຕົ້ນການຕິດຕາມກວດກາ.

ແກ້ໄຂຂະບວນການກວດສອບການເລີ່ມຕົ້ນ Monit ຫາຍໄປ monit.service ລົ້ມເຫລວ.

Monit ເລີ່ມຂະບວນການຕິດຕາມ ແລະຫາຍໄປ, ກະຕຸ້ນ monit.service faiນຳ ພາ.

ຫຼັງຈາກ ຕິດຕັ້ງຊອບແວຕິດຕາມກວດກາ Monit ໃນ ແຜງຄວບຄຸມ CWP (CWP7) , ຂະບວນການຕິດຕາມກວດກາ Monit ຈະຫາຍໄປ, ແລະຂໍ້ຄວາມ "monit.service failed" ຈະປາກົດຂຶ້ນ.

ມັນເປັນມູນຄ່າທີ່ສັງເກດວ່າໄດ້ພະຍາຍາມເປີດໃຊ້ງານsystemctl 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.

ຄວາມຈິງສະແດງໃຫ້ເຫັນວ່າມັນ/var/www/html/nfsແມ່ນໂຟນເດີທີ່ຕິດຢູ່ກັບໄດຣຟ໌ເຄືອຂ່າຍຜ່ານ NFS.

Monit ໄດ້ເລີ່ມຕົ້ນກ່ອນ NFS, ດັ່ງນັ້ນໂຟນເດີຍັງບໍ່ມີ, ເຊິ່ງກໍ່ໃຫ້ເກີດຄວາມຜິດພາດ MonitError opening the log file '/var/www/html/nfs/monit/stage-web-1.log' for writing -- No such file or directory.

ວິ​ທີ​ການ​ແກ້​ໄຂ​ການ​ຫາຍ​ໄປ​ຂອງ​ຂະ​ບວນ​ການ​ຕິດ​ຕາມ​ກວດ​ກາ​ການ​ເລີ່ມ​ຕົ້ນ Monit monit.service ສົບ​ຜົນ​ສໍາ​ເລັດ​.

ການ​ແກ້​ໄຂ​ແມ່ນ​ການ​ແກ້​ໄຂ​/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

ແລະເພີ່ມnfs.serviceກັບAfterຫລັງ.ຜົນໄດ້ຮັບສຸດທ້າຍເບິ່ງຄືວ່ານີ້:

[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

ດຽວນີ້ Monit Monit ສາມາດເລີ່ມສຳເລັດແລ້ວໃນເວລາເປີດເຄື່ອງ.

ຫວັງວ່າ ບົດຄວາມ "ການແກ້ໄຂບັນຫາຂະບວນການຕິດຕາມກວດກາ Monit ທີ່ຫາຍໄປເມື່ອເລີ່ມຕົ້ນ: monit.service ລົ້ມເຫລວ." ທີ່ແບ່ງປັນໃນ ບລັອກຂອງ Chen Weiliang ( https://www.chenweiliang.com/ ) ຈະເປັນປະໂຫຍດຕໍ່ທ່ານ.

ຮູ້ສຶກວ່າບໍ່ເສຍຄ່າທີ່ຈະແບ່ງປັນລິ້ງຂອງບົດຄວາມນີ້: https://www.chenweiliang.com/cwl-1422.html

ເພື່ອປົດລັອກເຄັດລັບທີ່ເຊື່ອງໄວ້ເພີ່ມເຕີມ🔑, ຍິນດີຕ້ອນຮັບເຂົ້າສູ່ຊ່ອງ Telegram ຂອງພວກເຮົາ!

Share and like ຖ້າທ່ານມັກມັນ! ການແບ່ງປັນ ແລະຖືກໃຈຂອງເຈົ້າເປັນແຮງຈູງໃຈຢ່າງຕໍ່ເນື່ອງຂອງພວກເຮົາ!

 

评论评论

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

ເລື່ອນໄປທາງເທີງ