-
-
Save erikh/9f5813409cf0f9daed5d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AService < SM::Service | |
monitor :flap, :action => :stop, :tries => 2 | |
groups [ :cool_service, :fart ] | |
# this works | |
config_from :chef, :databag => "services", :item => "a_service" | |
config_from :redis, :hash => "a_service" | |
config_from :dus, :url => "http://some.thing.com/service.json" | |
# or this | |
def start | |
exec "fart" | |
end | |
def stop(pid) | |
kill(pid) | |
end | |
# or this | |
start_command "fart" | |
pidfile "/var/run/fart.pid" # pids should be tracked automatically unless this is specified. | |
# custom monitors can be defined at any point | |
def custom_monitor | |
# ping isn't a real function, just an idea of how this would work | |
ping("host") == 0 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment