Los het Monit-opstartbewakingsproces op. Monit.service is mislukt.

Monitor monitoring软件Kan monitoring niet starten bij opstarten.

Los het Monit-opstartbewakingsproces op. Monit.service is mislukt.

Monit start het monitoringproces en verdwijnt, waarna monit.service f wordt gevraagdaiLED.

CWP-configuratiescherm (CWP7) om Monit-monitoring te installerenNadat de software is geïnstalleerd, verdwijnt het bewakingsproces van het opstarten van Monit en verschijnt er een prompt: monit.service failed.

Het is vermeldenswaard dat er een poging is gedaan omsystemctl 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.

Feiten tonen aan dat het/var/www/html/nfsis een map die via NFS op een netwerkstation is gemount.

Monit is gestart vóór NFS, dus de map bestond nog niet, waardoor de monit-fout werd veroorzaaktError opening the log file '/var/www/html/nfs/monit/stage-web-1.log' for writing -- No such file or directory.

Hoe de verdwijning van het Monit-opstartbewakingsproces monit.service mislukt.?

De oplossing is om te bewerken/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

en voeg toenfs.service到该AfterAchter.Het eindresultaat ziet er als volgt uit:

[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

De Monit-monitor kan nu met succes opstarten bij het opstarten.

Hoop Chen Weiliang Blog ( https://www.chenweiliang.com/ ) deelde "Oplossen van het Monit-opstartbewakingsproces Verdwijning monit.service mislukt.", wat nuttig voor u is.

Welkom om de link van dit artikel te delen:https://www.chenweiliang.com/cwl-1422.html

Welkom op het Telegram-kanaal van Chen Weiliang's blog voor de laatste updates!

🔔 Wees de eerste die de waardevolle "ChatGPT Content Marketing AI Tool Usage Guide" in de bovenste kanaaldirectory ontvangt! 🌟
📚 Deze gids bevat enorme waarde, 🌟Dit is een zeldzame kans, mis hem niet! ⏰⌛💨
Deel en like als je wilt!
Uw delen en likes zijn onze voortdurende motivatie!

 

发表 评论

Uw e-mailadres wordt niet gepubliceerd. 必填 项 已 用 * 标注

scroll naar boven