diff options
author | Jakob Unterwurzacher | 2018-10-17 22:01:37 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2018-10-17 22:18:03 +0200 |
commit | 3cd892ccdee9cef6e2fd9ad14cb12f643e4a6fb3 (patch) | |
tree | 8fbf21edde137d928fee4db528acf2dce43f75e4 | |
parent | 0751b4e00a3cbb7e940e39d76abadd21aadcd16c (diff) |
main: also redirect Fatal logger to syslog on daemonization
The messages would still be collected via gocryptfs-logger,
but let's do it right.
Before:
Oct 17 21:58:12 brikett gocryptfs[9926]: testing info
Oct 17 21:58:12 brikett gocryptfs[9926]: testing warn
Oct 17 21:58:12 brikett gocryptfs-9926-logger[9935]: testing fatal
After:
Oct 17 22:00:53 brikett gocryptfs[10314]: testing info
Oct 17 22:00:53 brikett gocryptfs[10314]: testing warn
Oct 17 22:00:53 brikett gocryptfs[10314]: testing fatal
-rw-r--r-- | mount.go | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -116,6 +116,7 @@ func doMount(args *argContainer) { tlog.Info.SwitchToSyslog(syslog.LOG_USER | syslog.LOG_INFO) tlog.Debug.SwitchToSyslog(syslog.LOG_USER | syslog.LOG_DEBUG) tlog.Warn.SwitchToSyslog(syslog.LOG_USER | syslog.LOG_WARNING) + tlog.Fatal.SwitchToSyslog(syslog.LOG_USER | syslog.LOG_CRIT) tlog.SwitchLoggerToSyslog(syslog.LOG_USER | syslog.LOG_WARNING) // Daemons should redirect stdin, stdout and stderr redirectStdFds() |