We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5e626e7 commit 8fa4e15Copy full SHA for 8fa4e15
1 file changed
common/utils.py
@@ -48,8 +48,11 @@ def pid_file_name(node_type: str, node_name: str) -> str:
48
"""
49
The name of the file that is used to store the process ID.
50
51
- # TODO: Use a better choice for the temp directory than /tmp
52
- return f"/tmp/dske-{node_type}-{node_name}.pid"
+ file_name = f"dske-{node_type}-{node_name}.pid"
+ dir_name = "/var/run"
53
+ if os.path.exists(dir_name) and os.access(dir_name, os.W_OK):
54
+ return f"{dir_name}/{file_name}"
55
+ return file_name
56
57
58
def create_pid_file(node_type: str, node_name: str) -> None:
0 commit comments