summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2015-10-11 18:02:48 +0200
committerJakob Unterwurzacher2015-10-11 18:02:48 +0200
commit14115b061b253f3c58eee731e3b38dbb18fcf1fa (patch)
tree26592191dca7e5d1c469d1e7f5674634b0ecf81e /main.go
parent39183bea00f0d064f0cb96427dff150799d1dbe5 (diff)
Add native daemonization
Diffstat (limited to 'main.go')
-rw-r--r--main.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/main.go b/main.go
index 89f3723..2d6da05 100644
--- a/main.go
+++ b/main.go
@@ -66,7 +66,7 @@ func main() {
runtime.GOMAXPROCS(4)
// Parse command line arguments
- var debug, init, zerokey, fusedebug, openssl, passwd bool
+ var debug, init, zerokey, fusedebug, openssl, passwd, foreground bool
var masterkey string
flag.Usage = usageText
@@ -76,10 +76,14 @@ func main() {
flag.BoolVar(&zerokey, "zerokey", false, "Use all-zero dummy master key")
flag.BoolVar(&openssl, "openssl", true, "Use OpenSSL instead of built-in Go crypto")
flag.BoolVar(&passwd, "passwd", false, "Change password")
+ flag.BoolVar(&foreground, "f", false, "Stay in the foreground")
flag.StringVar(&masterkey, "masterkey", "", "Mount with explicit master key")
var cpuprofile = flag.String("cpuprofile", "", "Write cpu profile to specified file")
flag.Parse()
+ if ! foreground {
+ daemonize() // does not return
+ }
if *cpuprofile != "" {
f, err := os.Create(*cpuprofile)
if err != nil {