We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
/opt/dsf/conf/config.json
1 parent a29b854 commit 553d15aCopy full SHA for 553d15a
src/dsf/__init__.py
@@ -1,8 +1,23 @@
1
__version__ = "3.6.0-rc1.post1"
2
3
-# path to unix socket file
+import json
4
+import os
5
+
6
+# Default socket file path
7
SOCKET_FILE = "/run/dsf/dcs.sock"
8
9
+# Try to read socket file path from config
10
+config_path = "/opt/dsf/conf/config.json"
11
+if os.path.exists(config_path):
12
+ try:
13
+ with open(config_path, 'r') as f:
14
+ config = json.load(f)
15
+ socket_dir = config.get("SocketDirectory", "/run/dsf")
16
+ socket_file = config.get("SocketFile", "dcs.sock")
17
+ SOCKET_FILE = os.path.join(socket_dir, socket_file)
18
+ except (json.JSONDecodeError, IOError):
19
+ pass # Use default if config file is invalid or inaccessible
20
21
# allowed connection per unix server
22
DEFAULT_BACKLOG = 4
23
0 commit comments