Hi,
I want to disable the start of a daemon until an barier file exist.
So I tried the following example configuration.
I do not expect that 'crond' is started if the
dependent file does not exist.
Too, after the message:
'crond' service timed out and will not be checked anymore
it should not started anymore, or not?
claus
P3linux:/etc # monit -v summary
monit: Debug: Adding host allow 'localhost' (127.0.0.1).
Runtime constants:
Control file = /etc/monitrc
Log file = syslog
Pid file = /var/run/monit.pid
Debug = True
Log = True
Use syslog = True
Is Daemon = True
Use process engine = True
Poll time = 120 seconds
Mail server(s) = localhost
Mail from = [EMAIL PROTECTED]
Mail subject = monit alert -- $EVENT $SERVICE
Mail message = $EVENT Service $SERV..(truncated)
Start monit httpd = True
httpd bind address = localhost
httpd portnumber = 2812
httpd signature = True
Use ssl encryption = False
httpd auth. style = Basic Authentication and Host/Net allow list
Alert mail to = [EMAIL PROTECTED]
Alert on = All events
The service list contains the following entries:
...
Process Name = crond
Group = system
Pid file = /var/run/crond.pid
Monitoring mode = active
Start program = /bin/logger -p local0.notice -t monit 'crond start'
Stop program = /bin/logger -p local0.notice -t monit 'crond stop'
Depends on Service = cron_rc
Pid = if changed 1 times within 1 cycle(s) then alert
Ppid = if changed 1 times within 1 cycle(s) then alert
Timeout = If 5 restart within 5 cycles then unmonitor else if
passed then alert
File Name = cron_rc
Group = system
Path = /etc/init.d/crond
Monitoring mode = active
-------------------------------------------------------------------------------
The monit daemon 4.6 uptime: 33m
System 'P3linux' [1.30] [1.24] [1.38]
Process 'privoxy' running
Process 'snmpd' running
Process 'sshd' running
P3linux:/etc #
P3linux:/etc # grep monit /var/log/messages | tail -40
Nov 9 21:31:34 P3linux monit[2113]: 'crond' process is not running
Nov 9 21:31:34 P3linux monit[2113]: 'crond' trying to restart
Nov 9 21:31:34 P3linux monit[2113]: 'crond' start: /bin/logger
Nov 9 21:31:34 P3linux monit: crond start
Nov 9 21:31:34 P3linux monit[2113]: 'cron_rc' file doesn't exist
Nov 9 21:31:34 P3linux monit[2113]: 'cron_rc' trying to restart
Nov 9 21:33:34 P3linux monit[2113]: 'crond' failed to start
Nov 9 21:33:36 P3linux monit[2113]: 'crond' process is not running
Nov 9 21:33:36 P3linux monit[2113]: 'crond' trying to restart
Nov 9 21:33:36 P3linux monit[2113]: 'crond' start: /bin/logger
Nov 9 21:33:36 P3linux monit: crond start
Nov 9 21:33:36 P3linux monit[2113]: 'cron_rc' file doesn't exist
Nov 9 21:33:36 P3linux monit[2113]: 'cron_rc' trying to restart
Nov 9 21:35:36 P3linux monit[2113]: 'crond' failed to start
Nov 9 21:35:38 P3linux monit[2113]: 'crond' process is not running
Nov 9 21:35:38 P3linux monit[2113]: 'crond' trying to restart
Nov 9 21:35:38 P3linux monit[2113]: 'crond' start: /bin/logger
Nov 9 21:35:38 P3linux monit: crond start
Nov 9 21:35:38 P3linux monit[2113]: 'cron_rc' file doesn't exist
Nov 9 21:35:38 P3linux monit[2113]: 'cron_rc' trying to restart
Nov 9 21:37:38 P3linux monit[2113]: 'crond' failed to start
Nov 9 21:37:40 P3linux monit[2113]: 'crond' process is not running
Nov 9 21:37:40 P3linux monit[2113]: 'crond' trying to restart
Nov 9 21:37:40 P3linux monit[2113]: 'crond' start: /bin/logger
Nov 9 21:37:40 P3linux monit: crond start
Nov 9 21:37:40 P3linux monit[2113]: 'cron_rc' file doesn't exist
Nov 9 21:37:40 P3linux monit[2113]: 'cron_rc' trying to restart
Nov 9 21:39:40 P3linux monit[2113]: 'crond' failed to start
Nov 9 21:39:42 P3linux monit[2113]: 'crond' service timed out and will not be
checked anymore
Nov 9 21:39:42 P3linux monit[2113]: 'cron_rc' file doesn't exist
Nov 9 21:39:42 P3linux monit[2113]: 'cron_rc' trying to restart
Nov 9 21:39:42 P3linux monit[2113]: 'crond' start: /bin/logger
Nov 9 21:39:42 P3linux monit: crond start
Nov 9 21:41:42 P3linux monit[2113]: 'crond' failed to start
Nov 9 21:41:44 P3linux monit[2113]: 'crond' process is not running
Nov 9 21:41:44 P3linux monit[2113]: 'crond' trying to restart
Nov 9 21:41:44 P3linux monit[2113]: 'crond' start: /bin/logger
Nov 9 21:41:44 P3linux monit: crond start
Nov 9 21:41:44 P3linux monit[2113]: 'cron_rc' file doesn't exist
Nov 9 21:41:44 P3linux monit[2113]: 'cron_rc' trying to restart
...
Nov 9 21:47:50 P3linux monit[2113]: 'crond' trying to restart
Nov 9 21:47:50 P3linux monit[2113]: 'crond' start: /bin/logger
Nov 9 21:47:50 P3linux monit: crond start
Nov 9 21:47:50 P3linux monit[2113]: 'cron_rc' file doesn't exist
Nov 9 21:47:50 P3linux monit[2113]: 'cron_rc' trying to restart
P3linux:/etc #
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general