From bc4bebfb92ec59fbc0e86dbf7a62efa127734023 Mon Sep 17 00:00:00 2001 From: Daniel Badea Date: Wed, 17 Jul 2019 12:48:26 +0000 Subject: [PATCH] ceph: mgr-restful-plugin pid file issues mgr-restful-plugin is writing service pid to associated pid file but does not flush or close the file descriptor. When SM tris to read the pid number from pid file it fails because the file exists but it's empty. Flush pid file after writing pid value. Closes-Bug: 1836897 Change-Id: If34293719f330d89c150fff8491c40a08581a58b Signed-off-by: Daniel Badea --- ceph/ceph/files/mgr-restful-plugin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ceph/ceph/files/mgr-restful-plugin.py b/ceph/ceph/files/mgr-restful-plugin.py index c1cae6067..7d406037c 100644 --- a/ceph/ceph/files/mgr-restful-plugin.py +++ b/ceph/ceph/files/mgr-restful-plugin.py @@ -488,6 +488,7 @@ class ServiceMonitor(object): try: pid_file = open(CONFIG.service_pid_file, 'w') pid_file.write(str(os.getpid())) + pid_file.flush() except OSError as err: raise ServiceNoPidFile( path=CONFIG.service_pid_file, reason=str(err))