[ARVADOS] updated: f573c35a8f829ac4624f4ef9fbe0d0178a734fa3
git at public.curoverse.com
git at public.curoverse.com
Tue Jun 24 15:02:05 EDT 2014
Summary of changes:
services/fuse/bin/arv-mount | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
via f573c35a8f829ac4624f4ef9fbe0d0178a734fa3 (commit)
from bfaad44c23b334c91d347acb1517fd750f13e0c3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit f573c35a8f829ac4624f4ef9fbe0d0178a734fa3
Author: Brett Smith <brett at curoverse.com>
Date: Tue Jun 24 15:02:39 2014 -0400
Fix bad interaction between llfuse and daemonization in arv-mount.
Following PEP 3143, daemon.DaemonContext drops all open file
descriptors by default. This causes arv-mount to fail, because
llfuse.init() opens /dev/fuse, and llfuse.main() uses that file
descriptor. We now daemonize before doing real work to prevent this
unintentional breakage.
This effectively reverts 83c873af. An alternative approach would've
been to call DaemonContext with a preserve_files argument. I decided
against that because I couldn't find a reliable way to determine
which file descriptors llfuse needs. If we really need the daemon to
report errors, and debugging with --foreground isn't sufficient, I
think we should implement proper logging to a file or syslog.
No issue #.
diff --git a/services/fuse/bin/arv-mount b/services/fuse/bin/arv-mount
index b4afffa..db8e852 100755
--- a/services/fuse/bin/arv-mount
+++ b/services/fuse/bin/arv-mount
@@ -1,11 +1,13 @@
#!/usr/bin/env python
-from arvados_fuse import *
-import arvados
-import subprocess
import argparse
+import arvados
import daemon
+import os
import signal
+import subprocess
+
+from arvados_fuse import *
if __name__ == '__main__':
# Handle command line parameters
@@ -91,12 +93,9 @@ collections on the server.""")
exit(rc)
else:
- if args.foreground:
- # Initialize the fuse connection
- llfuse.init(operations, args.mountpoint, opts)
- llfuse.main()
- else:
- # Initialize the fuse connection
- llfuse.init(operations, args.mountpoint, opts)
- with daemon.DaemonContext():
- llfuse.main()
+ os.chdir(args.mountpoint)
+ if not args.foreground:
+ daemon_ctx = daemon.DaemonContext(working_directory='.')
+ daemon_ctx.open()
+ llfuse.init(operations, '.', opts)
+ llfuse.main()
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list