comparison libervia/backend/core/launcher.py @ 4202:b26339343076

core: use a user specific directory for PID file: default location of pid file is now specific to logged user, this allow to run several instances of Libervia by different users on the same machine without PID conflicts.
author Goffi <goffi@goffi.org>
date Sun, 14 Jan 2024 17:48:02 +0100
parents 3dbaf179c50d
children
comparison
equal deleted inserted replaced
4201:6a8cc6d668a4 4202:b26339343076
195 sys.exit(1) 195 sys.exit(1)
196 return config 196 return config
197 197
198 def get_pid_file(self, config): 198 def get_pid_file(self, config):
199 pid_dir = Path(config.get("DEFAULT", "pid_dir")).expanduser() 199 pid_dir = Path(config.get("DEFAULT", "pid_dir")).expanduser()
200 pid_dir.mkdir(parents=True, exist_ok=True)
200 return pid_dir / f"{self.APP_NAME_FILE}.pid" 201 return pid_dir / f"{self.APP_NAME_FILE}.pid"
201 202
202 def wait_for_service( 203 def wait_for_service(
203 self, 204 self,
204 service_host: str, 205 service_host: str,