diff options
author | Ruben Pollan <meskio@sindominio.net> | 2020-09-15 22:30:32 +0200 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2020-09-16 18:57:21 +0200 |
commit | 5b6bb5ced2ef2c359202b3c2aa1721c3c7f0d6b2 (patch) | |
tree | f9a159a4a1243687079cc07e51b0322b471e201f /pkg/backend/api.go | |
parent | 0a45a565319fb3b740e761cf68bce87885589a4f (diff) |
[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
Diffstat (limited to 'pkg/backend/api.go')
-rw-r--r-- | pkg/backend/api.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/backend/api.go b/pkg/backend/api.go index ea148f7..9706bdf 100644 --- a/pkg/backend/api.go +++ b/pkg/backend/api.go @@ -11,6 +11,7 @@ import ( "0xacab.org/leap/bitmask-vpn/pkg/bitmask" "0xacab.org/leap/bitmask-vpn/pkg/config/version" + "0xacab.org/leap/bitmask-vpn/pkg/pid" "0xacab.org/leap/bitmask-vpn/pkg/pickle" ) @@ -56,6 +57,7 @@ func Quit() { if ctx.bm != nil { ctx.bm.Close() } + pid.ReleasePID() } func DonateAccepted() { |