David Lyon
unread,Jul 1, 2013, 9:32:21 PM7/1/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sydney...@googlegroups.com
Thanks guys.
Supervisor was really what I was expecting. When I looked more closely I noticed there was a lot more documentation and the project is much more significant.
However, when I tweaked 'monitoring', I got it to do what I wanted fairly easily. Here was my script to get 'geany' running and stay running. Every time you close it, the process restarts:
from monitoring import *
__doc__ = """How to ensure that Geany stays up and running."""
Monitor(
Service(
name="geany-ensure-up",
monitor=(
ProcessInfo(command='geany',
freq=Time.ms(1000),
fail=[
Incident(
# If we have 5 errors during 5 seconds...
errors=5,
during=Time.s(5),
actions=[
# NOTE: Restart will make the process a child of the monitoring, so
# you might prefer to use something like upstart
Restart("geany")
]
)
]
)
)
)
).run()