aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Program.cs
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-08-24 07:39:16 -0600
committercrobibero <cody@robibe.ro>2020-08-24 07:39:16 -0600
commit9626101c9f8d0acceb2ecf97bed502c272d6e4f6 (patch)
tree00d7edea6d98b2b36cd5487439ed15e4c9dcb491 /Jellyfin.Server/Program.cs
parentef0a7c3e2a24519142c912837be4beefcd07e421 (diff)
parent7ce21d436baa2ffe80e7723f3d0887db7a0eeaf1 (diff)
Merge remote-tracking branch 'upstream/master' into 3.1.7
Diffstat (limited to 'Jellyfin.Server/Program.cs')
-rw-r--r--Jellyfin.Server/Program.cs21
1 files changed, 17 insertions, 4 deletions
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs
index 9fd706d36..f6ac4e2a3 100644
--- a/Jellyfin.Server/Program.cs
+++ b/Jellyfin.Server/Program.cs
@@ -344,11 +344,24 @@ namespace Jellyfin.Server
}
}
- // Bind to unix socket (only on OSX and Linux)
- if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ // Bind to unix socket (only on macOS and Linux)
+ if (startupConfig.UseUnixSocket() && !RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
- // TODO: allow configuration of socket path
- var socketPath = $"{appPaths.DataPath}/socket.sock";
+ var socketPath = startupConfig.GetUnixSocketPath();
+ if (string.IsNullOrEmpty(socketPath))
+ {
+ var xdgRuntimeDir = Environment.GetEnvironmentVariable("XDG_RUNTIME_DIR");
+ if (xdgRuntimeDir == null)
+ {
+ // Fall back to config dir
+ socketPath = Path.Join(appPaths.ConfigurationDirectoryPath, "socket.sock");
+ }
+ else
+ {
+ socketPath = Path.Join(xdgRuntimeDir, "jellyfin-socket");
+ }
+ }
+
// Workaround for https://github.com/aspnet/AspNetCore/issues/14134
if (File.Exists(socketPath))
{