Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions go/vt/mysqlctl/mysqld.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ var (

poolDynamicHostnameResolution = flag.Duration("pool_hostname_resolve_interval", 0, "if set force an update to all hostnames and reconnect if changed, defaults to 0 (disabled)")

socketFile = flag.String("mysqlctl_socket", "", "socket file to use for remote mysqlctl actions (empty for local actions)")
mycnfTemplateFile = flag.String("mysqlctl_mycnf_template", "", "template file to use for generating the my.cnf file during server init")
socketFile = flag.String("mysqlctl_socket", "", "socket file to use for remote mysqlctl actions (empty for local actions)")

// masterConnectRetry is used in 'SET MASTER' commands
masterConnectRetry = flag.Duration("master_connect_retry", 10*time.Second, "how long to wait in between slave -> connection attempts. Only precise to the second.")
Expand Down Expand Up @@ -793,7 +794,13 @@ func (mysqld *Mysqld) initConfig(cnf *Mycnf, outFile string) error {
}

func (mysqld *Mysqld) getMycnfTemplate() string {

if *mycnfTemplateFile != "" {
data, err := ioutil.ReadFile(*mycnfTemplateFile)
if err != nil {
log.Fatalf("template file specified by -mysqlctl_mycnf_template could not be read: %v", *mycnfTemplateFile)
}
return string(data) // use only specified template
}
myTemplateSource := new(bytes.Buffer)
myTemplateSource.WriteString("[mysqld]\n")

Expand Down