Contemplating syncing ~/.local/share/evolution via syncthing as a way to sync contacts etc. on my pinephone.

That's how I've been keeping my keepass password db sync'd across machines. So far keepassxc and related clients handle it pretty gracefully. If I try to save and the DB has changed out from under it in the meantime, I'm prompted whether I want to reload first. If syncthing notices conflicts when syncing and leaves a conflict file for me, I can use keepass to merge the extra copies of the db and then delete them.

Anyway, yolo

mv ~/.local/share/evolution /var/lib/syncthing/Sync
ln -s /var/lib/syncthing/Sync/evolution ~/.local/share/evolution

Permissions are a little tricky. I think I want everything in syncthing's directory to be owned by syncthing, but I need to still have access.

I've chown'd the directory to syncthing.syncthing, but not everything is group-accessible, so my user can't access it anymore.

I could just recursively set everything to g+rwx, but that'd be weird for files that shouldn't be executable.

It'd be nice if there were a simple command to "copy the user permissions to the group permissions".

Since there shouldn't actually be any executables there I can probably get away with just setting everything g+rw, and then the directories go g+x.

sudo chmod -R g+rw /var/lib/syncthing/Sync/evolution
sudo find /var/lib/syncthing/Sync/evolution -type d -exec c
hmod g+x \{\} \;

Apparently syncevolution is a thing. I don't want to deal with teaching every program whose backing store I want to sync about which devices to sync to and how to contact them, though.

One of the mechanisms syncevolution can use is 'SyncML' which looks like a generic synchronization protocol. I wonder if there's a "syncthing for SyncML"...

Anyway, let's see how well this works...

I added a single contact on my phone, installed evolution on my desktop, and symlinked the evolution directory to the syncthing directory there.

Opened evolution and... contacts is empty. Tried to add a contact there and it claims the db is read-only. Hmm...

Double-checked and the file permissions look good. Also strace'd evolution and didn't see any errors opening the files.

I suspect it's a lock inside the db file itself. Tried closing the contacts app on my phone, ensuring syncthing had syncd, and trying again, but still no luck. Hmm.

Aaand now I get the same error if I try to save changes from my phone.


I haven't bothered to actually populate the DB yet, so not actually that big of a deal...

· · Web · 1 · 0 · 0

Examining the strace output further, it doesn't appear to try to directly open the db at all... but *does* do a bunch of IPC.

There are some persistent /user/libexec/evolution-* processes, so most likely one of these is holding some kind of lock on the database.

I think it's back to the drawing-board here. Maybe I'll take a closer look at syncevolution...

TIL about lsof(8). Sure enough, even with gnome-contacts closed:

$ lsof | grep /home/user/.local/share/evolution
3398 /usr/libexec/evolution-addressbook-factory /home/user/.local/share/evolution/addressbook/system/contacts.db

Sign in to participate in the conversation

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!