monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why are the services not started automatically on reboot?


From: Lutz Mader
Subject: Re: Why are the services not started automatically on reboot?
Date: Sun, 11 Aug 2019 18:19:08 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

Hello Markus,
let us know the used Monit version (the output from monit -V) and the
Linux version you used.

With regards, Lutz

p.s.
You are using RHEL I think?

Are you using Systemd to start your applications or handle Monit the
application startup only?

Any dependency defined for the services?

p.s.
There is no reason to do a "monit start all" after your system is up and
running. As long as you use the default setting ("onreboot start") Monit
start all defined applications.

To prevent the default behaviour you can use "onreboot laststate", but
Monit does not start stopped applications after a system restart then.
But you can stop applications and do some maintenance after a system
restart and start the aplications manually.
You can use "onreboot" with any service definition also.

I use something like this, for example (with Monit 5.25.2).
check process Postgres with pidfile /var/run/pgsql/data.pid
  onreboot laststate
  start program "/bin/launchctl load -F
/Library/LaunchDaemons/org.postgresql.postmaster.plist"
  stop program "/bin/launchctl unload
/Library/LaunchDaemons/org.postgresql.postmaster.plist"
  if failed unixsocket /var/run/pgsql/.s.PGSQL.5432 then restart
#  if failed host macmini.local port 5432 then restart
  if 3 restarts within 30 cycles then unmonitor



reply via email to

[Prev in Thread] Current Thread [Next in Thread]