initialise repo
[debian/orchestra.git] / src / conductor / conductor.go
1 /* conductor.go
2 */
3
4 package main
5
6 import (
7         "flag"
8         "os"
9         o       "orchestra"
10 )
11
12 var (
13         ConfigFile = flag.String("config-file", "/etc/orchestra/conductor.conf", "File containing the conductor configuration")
14         DontVerifyPeer          = flag.Bool("dont-verify-peer", false, "Ignore TLS verification for the peer")
15         // this is used a lot for marshalling. I just can't stuff it
16         // anywhere else.
17         InvalidValueError = os.NewError("Invalid value")
18 )
19
20
21 func main() {
22         o.SetLogName("conductor")
23
24         // parse command line options.
25         flag.Parse()
26
27         // Start the client registry - configuration parsing will block indefinately
28         // if the registry listener isn't working
29         StartRegistry()
30
31         // do an initial configuration load - must happen before
32         // MakeSpoolDir and InitDispatch()
33         ConfigLoad()
34
35         // Build the Spool Tree if necessary
36         MakeSpoolDir()
37
38         // Load any old state we had.
39         LoadState()
40         defer SaveState()
41
42         // start the master dispatch system
43         InitDispatch()
44
45         // start the status listener
46         StartHTTP()
47         // start the audience listener
48         StartAudienceSock()
49         // service TLS requests.
50         ServiceRequests()
51 }