diff --git a/main.go b/main.go
index <HASH>..<HASH> 100644
--- a/main.go
+++ b/main.go
@@ -92,7 +92,7 @@ func main() {
 	}
 
 	dataPath := flag.Arg(0)
-	createFile(dataPath)
+	createDir(dataPath)
 
 	s := server.NewServer(dataPath, dbfile, snapAfter, host, port)
 	go func() {
@@ -139,6 +139,13 @@ func createFile(path string) *os.File {
 	return f
 }
 
+func createDir(path string) {
+	if err := os.MkdirAll(path, 0744); err != nil {
+		log.Errorf("Unable to create path: %s", err.Error())
+		os.Exit(1)
+	}
+}
+
 func reportLaunch() {
 	json := fmt.Sprintf(`{"os": "%s", "arch": "%s", "app": "rqlite"}`, runtime.GOOS, runtime.GOARCH)
 	data := bytes.NewBufferString(json)
Fix data path creation

With #<I> a bug was introduced, so rqlite raised a panic whenever
starting because data path wasn't correctly created.

This commit attempts to fix ths bug, and so #<I> changes can be
finally applied.