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

Lutz Mader <[email protected]>
Newsgroups gmane.comp.monitoring.monit.general
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.