mirror of
https://github.com/postmannen/ctrl.git
synced 2024-12-14 12:37:31 +00:00
fixed missing creation of database directory
This commit is contained in:
parent
693a6b819e
commit
b9934a7503
1 changed files with 7 additions and 0 deletions
|
@ -386,6 +386,13 @@ func (s *server) Start() {
|
|||
|
||||
// startAuditLog will start up the logging of all messages to audit file
|
||||
func (s *server) startAuditLog(ctx context.Context) {
|
||||
// Check if database folder exists, if not create it
|
||||
if _, err := os.Stat(s.configuration.DatabaseFolder); os.IsNotExist(err) {
|
||||
err := os.MkdirAll(s.configuration.DatabaseFolder, 0770)
|
||||
if err != nil {
|
||||
log.Fatalf("error: failed to create socket folder directory %v: %v", s.configuration.SocketFolder, err)
|
||||
}
|
||||
}
|
||||
|
||||
storeFile := filepath.Join(s.configuration.DatabaseFolder, "store.log")
|
||||
f, err := os.OpenFile(storeFile, os.O_APPEND|os.O_RDWR|os.O_CREATE, 0660)
|
||||
|
|
Loading…
Reference in a new issue