diff options
Diffstat (limited to 'src/slskd/Program.cs')
| -rw-r--r-- | src/slskd/Program.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index c51d07d8..29783216 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -345,12 +345,18 @@ namespace slskd return; } } - catch (Exception ex) + catch (IOException ex) { Log.Fatal($"Failed to acquire the application singleton mutex: {ex.Message}"); Log.Warning("This can happen when running in a restricted environment (e.g., Kubernetes with readOnlyRootFilesystem)"); Log.Warning("The application will continue, but multiple instances may be able to run simultaneously"); } + catch (UnauthorizedAccessException ex) + { + Log.Fatal($"Failed to acquire the application singleton mutex: {ex.Message}"); + Log.Warning("This can happen when running with insufficient permissions"); + Log.Warning("The application will continue, but multiple instances may be able to run simultaneously"); + } // derive the application directory value and defaults that are dependent upon it AppDirectory ??= DefaultAppDirectory; @@ -551,6 +557,7 @@ namespace slskd } finally { + Mutex?.Dispose(); Serilog.Log.CloseAndFlush(); } } |
