Permalink
Browse files

Update README.md

  • Loading branch information...
1 parent 94c3f57 commit 0ac9dbdc80a6d52e9d870ed2e8a53b714f561abb @sidorares committed Sep 26, 2012
Showing with 35 additions and 16 deletions.
  1. +35 −16 README.md
View
@@ -1,41 +1,47 @@
-FUSE filesystem exposing DBus services, objects, interfaces, methods and properies as filesystem objects. Implemented using dbus node.jd library and fuse4js FUSE node.js bindings. [![Build Status](https://secure.travis-ci.org/joyent/node.png)](http://travis-ci.org/sidorares/dbusfs)
+FUSE userspace dbus filesystem
===
+Exposes DBus services, objects, interfaces, methods and properies as filesystem objects. Implemented using [node-dbus](https://github.com/sidorares/node-dbus) [node.js](https://github.com/joyent/node) library and [fuse4js](https://github.com/vmware/fuse4js) [FUSE](http://fuse.sourceforge.net/) node.js bindings.
+
### Installation
+Make sure you have fuse4js [requirements](https://github.com/bcle/fuse4js#requirements)
+
```shell
-> npm install dbusfs
-``
+$ npm install dbusfs
+```
### Mount filesystem
Ensure the mount point is empty and you have wrx permissions to it
```shell
-> mkdir /tmp/fuse
-> dbusfs /tmp/fuse
+$ mkdir /tmp/fuse
+$ dbusfs /tmp/fuse
```
Unmounting:
```shell
-> fusermount -u /tmp/fuse
-``
+$ fusermount -u /tmp/fuse
+```
### Mappings
+First element in the path is always path name, then one or more elements of object path, then interface name, then interface member (method, property or signal).
+
```
/servicename/object/path/intarface.name/MethodName
/servicename/object/path/intarface.name/ReadableProperty
/servicename/object/path/intarface.name/WriteableProperty
-/servicename/object/path/intarface.name/MethodReturningArrayOfObjects
+/servicename/object/path/intarface.name/MethodAsExecutableFile
+/servicename/object/path/intarface.name/MethodReturningArrayOfObjects/SymlinkToObject/other.interface.name/Property
```
-real world examples:
+Root contains list of services
-list of services on my Ubuntu virtualbox:
```
-ls /tmp/fuse
+$ ls /tmp/fuse
:1.1 :1.13 :1.16 :1.2 :1.23 :1.27 :1.5 com.ubuntu.Upstart org.freedesktop.ConsoleKit org.freedesktop.NetworkManager
:1.11 :1.14 :1.17 :1.20 :1.24 :1.3 :1.6 org.bluez org.freedesktop.DBus org.freedesktop.PolicyKit1
:1.110 :1.15 :1.18 :1.21 :1.25 :1.30 :1.7 org.freedesktop.Accounts org.freedesktop.DisplayManager org.freedesktop.RealtimeKit1
@@ -47,7 +53,7 @@ If service name is the same as main interface name and object path = interface n
```
/some.long.service.name/some/long/service/name/some.long.service.name
```
-than `main` symlink is created to 'main' interface:
+then `main` symlink is created to 'main' interface:
```
$ ls -l /tmp/fuse/org.freedesktop.Accounts/main
@@ -61,6 +67,18 @@ total 0
-r-xr-xr-x 0 root root 153 Jan 1 1970 FindUserByName
dr--r--r-- 0 root root 4096 Jan 1 1970 ListCachedUsers
```
+Methods are mapped to shell script with corresponding [dbus-send](http://dbus.freedesktop.org/doc/dbus-send.1.html) command (at the moment you need to prefix parameter types manually)
+
+```
+cat /tmp/fuse/org.freedesktop.UPower/main/Hibernate
+#!/bin/sh
+dbus-send --system --print-reply --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Hibernate $1 $2 $3 $4
+
+$ /tmp/fuse/org.freedesktop.DBus/org.freedesktop.DBus/GetNameOwner string:com.ubuntu.Upstart
+method return sender=org.freedesktop.DBus -> dest=:1.55 reply_serial=2
+ string ":1.1"
+```
+
Methods with out "ao" signature are mapped to directory with symlinks
@@ -85,14 +103,15 @@ $ cat /tmp/fuse/org.freedesktop.Accounts/main/DaemonVersion
### TODO:
- add all items from this list as github issues
+ - grep TODO dbusfs.js
- add type modifiers to dbus-send generated scripts
- writeable properties
- make method returning object path a symlink to an object
- treat read properties returning object path or array of object paths same way as methods with that signature ( `/tmp/fuse/org.freedesktop.DisplayManager/org/freedesktop/DisplayManager/org.freedesktop.DisplayManager/Seats` )
- add --help switch to generated methods script to print argument names and types
- watch NameAcquired/NameOwnerChanged signals to track new/deleted services
- - watch ObjectManager's InterfaceAdded et al
- example:
+ - watch ObjectManager's InterfacesAdded
+ - expose some additional service properties (e.g link to /proc/[pid]/exe using org.freedesktop.DBus.GetConnectionUnixProcessID)
+ - map signals ( executable shell sctipt, dbus-monitor with corresponding match string? )
- fix dbus crash (reproduceable as `ls -l /tmp/fuse/com.ubuntu.Upstart/com/ubuntu/Upstart/jobs/acpid/_/com.ubuntu.Upstart0_6.Instance/processes`)
- - tests & travis-ci integration
-
+ - tests & travis-ci integration

0 comments on commit 0ac9dbd

Please sign in to comment.