diff options
Diffstat (limited to 'moonv4')
-rw-r--r-- | moonv4/moon_orchestrator/moon_orchestrator/server.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/moonv4/moon_orchestrator/moon_orchestrator/server.py b/moonv4/moon_orchestrator/moon_orchestrator/server.py index e6d28c23..959375be 100644 --- a/moonv4/moon_orchestrator/moon_orchestrator/server.py +++ b/moonv4/moon_orchestrator/moon_orchestrator/server.py @@ -104,8 +104,16 @@ def _exit(exit_number=0, docker=None, error=None): sys.exit(exit_number) +def __save_pid(): + try: + open("/var/run/moon_orchestrator.pid", "w").write(str(os.getpid())) + except PermissionError: + LOG.warning("You don't have the right to write PID file in /var/run... Continuing anyway.") + + def main(): # conf_file = options.configure(DOMAIN) + __save_pid() LOG.info("Starting server with IP {}".format(CONF.orchestrator.host)) docker_manager = DockerManager() |