Open gerroon opened 8 years ago
@elwint
Note that outside the distro environment unison only works with the
-ignorelocks
flag for some reason.Without the flag, what is the exit code? 159? Or anything else above 128 (indicating abnormal termination)? See my post above. I should add that for my use case
-ignorelocks
does not help.
Without the flag it throws a normal error that the archives are locked with exit code 3.
Note that outside the distro environment unison only works with the
-ignorelocks
flag for some reason.This is perfect solution. The last bit, we can start unison with the
-ignorelocks
flag, or we can addignorelocks = true
to prf file.
I remember that this was a bug due to misusage, that could be circumvented. But I can't remember where I got the answer anymore.
I’d rather not ignore locks, as the data is too important to mess up unison's reliability.
(I can also report it to work perfectly otherwise for everything else. If only Android would not limit itself to Windows file name reserved characters outside of Termux…)
Note that outside the distro environment unison only works with the
-ignorelocks
flag for some reason.This is perfect solution. The last bit, we can start unison with the
-ignorelocks
flag, or we can addignorelocks = true
to prf file.I remember that this was a bug due to misusage, that could be circumvented. But I can't remember where I got the answer anymore. I’d rather not ignore locks, as the data is too important to mess up unison's reliability.
(I can also report it to work perfectly otherwise for everything else. If only Android would not limit itself to Windows file name reserved characters outside of Termux…)
I found out the issue with strace, it seems that when it acquires a lock, it tries to create a hard link in the rename function. This is not allowed by Android SELinux policy, which is causing the error.
It looks like this function is only required on old NFS file systems where O_EXCL
is broken.
I did some testing and it seems that locks are also ignored if you run unison within proot with (fixed in https://github.com/termux/proot/issues/284)--link2symlink
because link2symlink
breaks the hard link check (the rename function always returns true, even if the lock file already exists).
If you don't use <NFSv3, simply remove these lines (so that it uses the create function instead) in lock.ml before compiling the binary to safely use unison in Termux without the -ignorelocks
flag outside proot.
After using locked version of unison-2.51.2 /ocaml 4.02.1 for a long time /Android, Linux) I compiled a working version of unison-2.53 /ocaml 4-5.1.0 for Android in termux.
I went with https://www.reddit.com/r/termux/comments/xtfquk/can_we_install_ocaml_on_termux/ # pkg install build-essential # curl -LO https://github.com/ocaml/ocaml/archive/refs/tags/5.1.1.zip # mkdir ~/tmp && export TMPDIR=$HOME/tmp # unzip 5.1.1.zip # cd ocaml-5.1.1 .# /configure --prefix=$PREFIX # make # make install
# curl -LO https://github.com/bcpierce00/unison/archive/v2.53.4.tar.gz # make
# src/unison -version
unison version 2.53.4 (ocaml 5.1.1)
Hi
It would be great if we have Unison and Duplicity in the repo. This will allow good backup options on Android.