package main

import (
	"log"
  "os"
  "os/signal"

	"smq/config"
	"smq/mqtt"
	"smq/snmp"
)


func main() {
  log.SetPrefix("SMQ: ")
  log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)

  log.Println("starting")

  config.LoadConfiguration()

  mqtt.Start()
  defer mqtt.Stop()

  snmp.Start()
  defer snmp.Stop()

  c := make(chan os.Signal, 1)
  signal.Notify(c, os.Interrupt, os.Kill)
  <- c

  log.Println("terminating")
}
