-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
67 lines (45 loc) · 1.83 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Copyright (c) 2010, 2011 Qualys, Inc.
Copyright (c) 2008 - 2010 Nemean Networks, LLC.
= Overview
+svdir+ is a Ruby interface to the "service directory" style of robust daemon
process supervision introducted in Dan Bernstein's +daemontools+ software and
compatibly extended in Gerit Pape's +runit+ package.
It exposes a programmatic interface to reliably starting, stopping, signalling
and interrogating services all implemented directly -- no need to shell out to
separate utilities. See the documentation for Sys::Sv::SvDir for complete
information.
More information on +daemontools+ is available at
http://cr.yp.to/daemontools.html. More information on +runit+ is available at
http://smarden.org/runit/.
== Example
The <tt>example/</tt> subdirectory in the source distribution contains a
demonstration program which a system adminstrator might use to control daemons.
Typical programmatic use of this software might look like this:
#! /usr/bin/env ruby
require 'sys/sv/svdir'
include Sys::Sv
# shut down all daemons running under /service
Dir["/service"].each do |svpath|
s = SvDir.new(svpath)
# force the .../log to shut down, ignoring services without loggers
s.log.signal(:exit) rescue nil
pid = s.pid
if pid != 0
s.signal(:exit)
puts "Told #{s.path} (pid #{pid}) to exit"
end
end
= Installation
Look for the gem on http://rubygems.org.
`rake package` will build a .gem under pkg/, and `rake rdoc` will
generate module documentation.
`rake test` and `rake rcov` will give a good idea of where the code is.
= To Do
* Further testing
- log()
- TAI64 testing
* Possible extensions
- <tt>SvDir.new(d) &block</tt> - persist StatusBytes object for block?
- <tt>normally_down!</tt> and <tt>normally_up!</tt>
= Author
Mike Pomraning ("mpomraning" at "qualys" dot "com")