diff options
author | Jakob Unterwurzacher | 2016-01-24 18:10:18 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2016-01-24 18:10:18 +0100 |
commit | 523e43068504fde769de7caf446c110c1e4204b2 (patch) | |
tree | b289b8c342fd57d5dcb36fdfcbe5f49b840946f3 /main.go | |
parent | 2f32114bd356c2124d75fb1879ff230fc1f0ca1b (diff) |
Add "-nosyslog" options
Also, actually redirect Warn and Debug as well.
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -37,7 +37,7 @@ const ( type argContainer struct { debug, init, zerokey, fusedebug, openssl, passwd, foreground, version, - plaintextnames, quiet, diriv, emenames, gcmiv128 bool + plaintextnames, quiet, diriv, emenames, gcmiv128, nosyslog bool masterkey, mountpoint, cipherdir, cpuprofile, config, extpass, memprofile string notifypid, scryptn int @@ -157,6 +157,7 @@ func main() { flagSet.BoolVar(&args.diriv, "diriv", true, "Use per-directory file name IV") flagSet.BoolVar(&args.emenames, "emenames", true, "Use EME filename encryption. This option implies diriv.") flagSet.BoolVar(&args.gcmiv128, "gcmiv128", true, "Use an 128-bit IV for GCM encryption instead of Go's default of 96 bits") + flagSet.BoolVar(&args.nosyslog, "nosyslog", false, "Do not redirect output to syslog when running in the background") flagSet.StringVar(&args.masterkey, "masterkey", "", "Mount with explicit master key") flagSet.StringVar(&args.cpuprofile, "cpuprofile", "", "Write cpu profile to specified file") flagSet.StringVar(&args.memprofile, "memprofile", "", "Write memory profile to specified file") @@ -298,9 +299,11 @@ func main() { if args.notifypid > 0 { sendUsr1(args.notifypid) - cryptfs.Info.SwitchToSyslog(syslog.LOG_USER | syslog.LOG_INFO) - cryptfs.Info.SwitchToSyslog(syslog.LOG_USER | syslog.LOG_DEBUG) - cryptfs.Info.SwitchToSyslog(syslog.LOG_USER | syslog.LOG_WARNING) + if !args.nosyslog { + cryptfs.Info.SwitchToSyslog(syslog.LOG_USER | syslog.LOG_INFO) + cryptfs.Debug.SwitchToSyslog(syslog.LOG_USER | syslog.LOG_DEBUG) + cryptfs.Warn.SwitchToSyslog(syslog.LOG_USER | syslog.LOG_WARNING) + } } // Wait for SIGINT in the background and unmount ourselves if we get it. // This prevents a dangling "Transport endpoint is not connected" mountpoint. |