summaryrefslogtreecommitdiffstats
path: root/xlators/features
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/features')
-rw-r--r--xlators/features/marker/utils/syncdaemon/gconf.py1
-rw-r--r--xlators/features/marker/utils/syncdaemon/gsyncd.py3
-rw-r--r--xlators/features/marker/utils/syncdaemon/syncdutils.py2
3 files changed, 4 insertions, 2 deletions
diff --git a/xlators/features/marker/utils/syncdaemon/gconf.py b/xlators/features/marker/utils/syncdaemon/gconf.py
index 24165b619..ddbac21e4 100644
--- a/xlators/features/marker/utils/syncdaemon/gconf.py
+++ b/xlators/features/marker/utils/syncdaemon/gconf.py
@@ -5,6 +5,7 @@ class GConf(object):
ssh_ctl_args = None
cpid = None
pid_file_owned = False
+ log_exit = False
permanent_handles = []
@classmethod
diff --git a/xlators/features/marker/utils/syncdaemon/gsyncd.py b/xlators/features/marker/utils/syncdaemon/gsyncd.py
index a502c2009..313bfdb0a 100644
--- a/xlators/features/marker/utils/syncdaemon/gsyncd.py
+++ b/xlators/features/marker/utils/syncdaemon/gsyncd.py
@@ -92,6 +92,7 @@ def startup(**kw):
else:
lkw['filename'] = kw['log_file']
GLogger.setup(label=kw.get('label'), **lkw)
+ gconf.log_exit = True
def main():
signal.signal(signal.SIGTERM, lambda *a: finalize(*a, **{'exval': 1}))
@@ -298,8 +299,6 @@ def main_i():
os.close(ffd)
local.service_loop(*[r for r in [remote] if r])
- logging.info("exiting.")
-
if __name__ == "__main__":
main()
diff --git a/xlators/features/marker/utils/syncdaemon/syncdutils.py b/xlators/features/marker/utils/syncdaemon/syncdutils.py
index 4bf51da74..49ef1662e 100644
--- a/xlators/features/marker/utils/syncdaemon/syncdutils.py
+++ b/xlators/features/marker/utils/syncdaemon/syncdutils.py
@@ -118,6 +118,8 @@ def finalize(*a, **kw):
raise
if gconf.ssh_ctl_dir and not gconf.cpid:
shutil.rmtree(gconf.ssh_ctl_dir)
+ if gconf.log_exit:
+ logging.info("exiting.")
sys.stdout.flush()
sys.stderr.flush()
os._exit(kw.get('exval', 0))