Friday, October 9, 2020

Ubuntu 18.04 and Unison

 I have been using Unison for several to sync files and I recently upgraded to 18.04 LTS.

Unision will no longer synch between the upgrade machine and my local machine. When a file is copied from my local machine to the upgraded machine, it copied well but the otherway around got an error
unison loadlocale.c _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed

After some trial and error the following workaround helped

1. Rename the unison executable. You can find it under (/usr/bin/unison-x.xx (to for e.g. /usr/bin/unison-x.xx.exe)
2. Rename the unison symbolic link /usr/bin/unison (to for e.g. /usr/bin/unison.exe) and  make it point to the new renamed executable in Step 1.
3. Create the following shell scripts and save it under the 2 original names
#!/bin/bash
LANG=C unison.exe "$@"

Worked like a charm. I know I will have issues when upgrading unison but I am hoping the bug in loadlocale.c is fixed before that.
Notes

a) You will have to be logged in as root for steps 1-3
b) Step 1 is necessary because when synching from a Windows machine through ssh, it searches and invokes unison
c) Step 2 is necessary because when synching from a Mac machine through ssh, it searches and invokes unison-x.xx
d) This workaround could've been made simpler for e.g. creating only one script, etc. but I wanted to retain the original deployment structure. When the issue is fixed all I have to do is to delete the scripts and do a rename.

No comments:

Post a Comment

Math Curriculums and Recommendations

This page is an attempt to list my list of math curriculums, books, programs that covers K-12 Basic Math knowledge - Basic Literacy  I have ...