コード例 #1
0
ファイル: main.go プロジェクト: rcj4747/lxd
	"github.com/lxc/lxd/internal/gnuflag"
	"github.com/lxc/lxd/lxd/migration"
	"github.com/lxc/lxd/shared"
)

func main() {
	if err := run(); err != nil {
		fmt.Fprintf(os.Stderr, "error: %v\n", err)
		os.Exit(1)
	}
}

var verbose = gnuflag.Bool("v", false, "Enables verbose mode.")
var syslogFlag = gnuflag.Bool("syslog", false, "Enables syslog logging.")
var logfile = gnuflag.String("logfile", "", "Logfile to log to (e.g., /var/log/lxd/lxd.log).")
var debug = gnuflag.Bool("debug", false, "Enables debug mode.")
var group = gnuflag.String("group", "", "Group which owns the shared socket.")
var help = gnuflag.Bool("help", false, "Print this help message.")
var version = gnuflag.Bool("version", false, "Print LXD's version number and exit.")
var printGoroutines = gnuflag.Int("print-goroutines-every", -1, "For debugging, print a complete stack trace every n seconds")
var cpuProfile = gnuflag.String("cpuprofile", "", "Enable cpu profiling into the specified file.")
var memProfile = gnuflag.String("memprofile", "", "Enable memory profiling into the specified file.")

func init() {
	myGroup, err := shared.GroupName(os.Getgid())
	if err != nil {
		shared.Debugf("Problem finding default group %s", err)
	}
	*group = myGroup
コード例 #2
0
ファイル: main.go プロジェクト: RuneTM/lxd
	"github.com/lxc/lxd/internal/gnuflag"
	"github.com/lxc/lxd/lxd/migration"
	"github.com/lxc/lxd/shared"
)

func main() {
	if err := run(); err != nil {
		fmt.Fprintf(os.Stderr, "error: %v\n", err)
		os.Exit(1)
	}
}

var verbose = gnuflag.Bool("v", false, "Enables verbose mode.")
var syslogFlag = gnuflag.Bool("syslog", false, "Enables syslog logging.")
var logfile = gnuflag.String("logfile", "", "Logfile to log to (e.g., /var/log/lxd/lxd.log).")
var debug = gnuflag.Bool("debug", false, "Enables debug mode.")
var listenAddr = gnuflag.String("tcp", "", "TCP address <addr:port> to listen on in addition to the unix socket (e.g., 127.0.0.1:8443).")
var group = gnuflag.String("group", "", "Group which owns the shared socket.")
var help = gnuflag.Bool("help", false, "Print this help message.")
var version = gnuflag.Bool("version", false, "Print LXD's version number and exit.")
var printGoroutines = gnuflag.Int("print-goroutines-every", -1, "For debugging, print a complete stack trace every n seconds")
var cpuProfile = gnuflag.String("cpuprofile", "", "Enable cpu profiling into the specified file.")
var memProfile = gnuflag.String("memprofile", "", "Enable memory profiling into the specified file.")

func init() {
	myGroup, err := shared.GroupName(os.Getgid())
	if err != nil {
		shared.Debugf("Problem finding default group %s", err)
	}
	*group = myGroup