Search code examples
gnomejhbuild

Running gvfs after building


I am trying to run a local build of gvfs. I have followed the Newcomers document to set up a working build environment, built gvfs from sources and am now trying to figure out how to run it.

The docs have instructions on running applications or the GNOME shell, which say I need to kill the current instance, then launch the newly-built binary with jhbuild run, as in:

$ killall gnome-weather
$ jhbuild run gnome-weather

or, in the case of the shell,

$ jhbuild run gnome-shell --replace

For gvfs, I see that it spawns a bunch of processes (all children of P1 running under my account), the first of them (lowest PID) being gvfsd. So I tried the following:

$ killall gvfsd
$ jhbuild run gvfs

Which gives me the error message:

jhbuild run: Unable to execute the command 'gvfs': [Errno 2] No such file or directory

If instead I try

$ jhbuild run gvfsd

I get the same message. Same when I try any of the above two with --replace.

Since gvfs is a daemon rather than an application, I searched around a bit and came across this post, which suggests launching daemons with

jhbuild run dbus-launch --exit-with-session name-of-daemon

No joy either... no matter whether I use gvfs or gvfsd for the name, I get the error message

Couldn't exec gvfs: No such file or directory

(reporting the name I specified in the command).

Is this the correct way to launch gvfs at all? If not, what is? If it is, how can I find out what's going wrong?

EDIT: Apparently, the code I intend to modify is part of the gvfs-mtp-volume-monitor binary – but essentially the same goes here. How do I launch my own version of the binary rather than the one that came with my OS distro?


Solution

  • jhbuild run can be used for gvfs in the same manner.

    For gvfsd do the following:

    jhbuild run ~/jhbuild/install/libexec/gvfsd -r
    

    The -r switch tells gvfsd to replace any running version. gvfsd will also start gvfsd-fuse if it was built and you didn't disable it via a command-line switch.

    You will also need to replace any volume monitors (and other processes you need), such as:

    killall gvfs-mtp-volume-monitor
    jhbuild run ~/jhbuild/install/libexec/gvfs-mtp-volume-monitor
    

    Care must be taken with anything that is invoked over dbus:

    • Namespaces may change between versions. If that happened between the version shipped with your OS and the current one, the latter will not work unless you tweak your dbus config to reflect that.
    • If dbus is used to spawn processes, it will fall back to the binaries shipped with your OS. Again you would need to modify your dbus config (specifically .service entries) to point to your binaries.