summaryrefslogtreecommitdiff
path: root/daemonize.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-11-17 17:03:11 +0100
committerJakob Unterwurzacher2018-11-17 17:03:11 +0100
commitd882ed45da9464e0e244cd8a3bf0168b5b618fd9 (patch)
treeceb3191c1f86c68b819496795d5e59fe1cdd2247 /daemonize.go
parent1ed08c7384c25fbe6fdaa0c0e70f32adf5a49892 (diff)
main: drop hardcoded /usr/bin/logger path
The hardcoded full paths were introduced to handle the case of an empty PATH environment variable. However, since commit 10212d791a3196c2c870 we set PATH to a default value if empty. The hardcoded paths are no longer neccessary, and cause problems on some distros: User voobscout on https://github.com/rfjakob/gocryptfs/issues/225#issuecomment-438682034 : just to chime in - please don't hardcode paths, for example I'm on NixOS and logger lives in /run/current-system/sw/bin/logger Drop the hardcoded paths.
Diffstat (limited to 'daemonize.go')
-rw-r--r--daemonize.go12
1 files changed, 3 insertions, 9 deletions
diff --git a/daemonize.go b/daemonize.go
index 40d9b64..6fdd1e4 100644
--- a/daemonize.go
+++ b/daemonize.go
@@ -72,15 +72,9 @@ func redirectStdFds() {
return
}
tag := fmt.Sprintf("gocryptfs-%d-logger", os.Getpid())
- // SUSE has /bin/logger, everybody else has /usr/bin/logger.
- for _, path := range []string{"/usr/bin/logger", "/bin/logger"} {
- cmd := exec.Command(path, "-t", tag)
- cmd.Stdin = pr
- err = cmd.Start()
- if err == nil {
- break
- }
- }
+ cmd := exec.Command("logger", "-t", tag)
+ cmd.Stdin = pr
+ err = cmd.Start()
if err != nil {
tlog.Warn.Printf("redirectStdFds: could not start logger: %v\n", err)
return