FS: remove .minio directory if .minio/multipart is empty. (#1899)

fixes #1886
This commit is contained in:
Krishna Srinivas
2016-06-16 08:50:38 +05:30
committed by Harshavardhana
parent de1c7d33eb
commit e2743d05e8
3 changed files with 82 additions and 0 deletions
+13
View File
@@ -17,9 +17,11 @@
package main
import (
"os"
"path/filepath"
"strings"
"sync"
"syscall"
)
const (
@@ -27,6 +29,17 @@ const (
blockSizeV1 = 10 * 1024 * 1024 // 10MiB.
)
// Register callback functions that needs to be called when process shutsdown.
// For now, SIGINT triggers the callbacks, in future controller can trigger
// shutdown callbacks.
func registerShutdown(callback func()) {
go func() {
trapCh := signalTrap(os.Interrupt, syscall.SIGTERM)
<-trapCh
callback()
}()
}
// House keeping code needed for FS.
func fsHouseKeeping(storageDisk StorageAPI) error {
// Attempt to create `.minio`.