aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-01-24 18:10:18 +0100
committerJakob Unterwurzacher2016-01-24 18:10:18 +0100
commit523e43068504fde769de7caf446c110c1e4204b2 (patch)
treeb289b8c342fd57d5dcb36fdfcbe5f49b840946f3 /main.go
parent2f32114bd356c2124d75fb1879ff230fc1f0ca1b (diff)
Add "-nosyslog" options
Also, actually redirect Warn and Debug as well.
Diffstat (limited to 'main.go')
-rw-r--r--main.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/main.go b/main.go
index 02f8eaa..69ee0af 100644
--- a/main.go
+++ b/main.go
@@ -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.