From 5b6bb5ced2ef2c359202b3c2aa1721c3c7f0d6b2 Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Tue, 15 Sep 2020 22:30:32 +0200 Subject: [bug] accept corrupted pid files A corrupted pid file, or a file that contains something else than a pid number used to block bitmask-vpn from launch. Now if the file contains something that is not expected it will log it and rewrite it. I refactor de code so the pid file will be released on quit instead of initialization. - Resolves: #349 --- pkg/bitmask/init.go | 8 -------- 1 file changed, 8 deletions(-) (limited to 'pkg/bitmask') diff --git a/pkg/bitmask/init.go b/pkg/bitmask/init.go index 7ac6f76..401f8a7 100644 --- a/pkg/bitmask/init.go +++ b/pkg/bitmask/init.go @@ -26,7 +26,6 @@ import ( "golang.org/x/text/message" "0xacab.org/leap/bitmask-vpn/pkg/config" - "0xacab.org/leap/bitmask-vpn/pkg/pid" "0xacab.org/leap/bitmask-vpn/pkg/vpn" ) @@ -107,13 +106,6 @@ func InitializeBitmask(skipLaunch bool) (Bitmask, error) { os.MkdirAll(config.Path, os.ModePerm) } - err := pid.AcquirePID() - if err != nil { - log.Println("Error acquiring PID:", err) - return nil, err - } - defer pid.ReleasePID() - conf := config.ParseConfig() conf.Printer = initPrinter() -- cgit v1.2.3