Not executable on Synology DSM 7.1 and above #409
-
Hi, I've run into an issue upgrading gyb. The binary seems not to be executable. That's a little odd since aside from updating my NAS' OS nothing else has changed. I do believe the NAS upgrade boke my install though, don't get me wrong. The backups stopped that same day but I had not noticed before I tried upgrading. I'm running a Synology DS412+ with DSM 7.1.1 on it. The chipset architecture is x86_64 as you'll see from the console output below. Python's also there, though not the latest and greatest, not that it should matter. The errors below, 126 (not executable) and 3 (directory not found), are telling I presume. ~/tmp $├> uname -m
x86_64
~/tmp $├> curl -L https://github.com/GAM-team/got-your-back/releases/download/v1.72/gyb-1.72-linux-x86_64-legacy.tar.xz --output /var/services/homes/admin/tmp/gyb.tar.xz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 13.2M 100 13.2M 0 0 3152k 0 0:00:04 0:00:04 --:--:-- 3910k
~/tmp $├> tar xf /var/services/homes/admin/tmp/gyb.tar.xz -C /var/services/homes/admin/tmp
~/tmp $├> cd gyb
~/tmp/gyb $├> ls -la
total 14M
-rwx------ 1 admin 14M Nov 1 21:54 gyb*
-rw------- 1 admin 10 Nov 1 21:54 lastcheck.txt
-rw------- 1 admin 12K Nov 1 21:54 LICENSE
~/tmp/gyb $├> gyb
bash: /var/services/homes/admin/bin/gyb/gyb: cannot execute binary file: Exec format error
~/tmp/gyb $├126─> ./gyb
Failed to execv() /tmp/staticx-FCmaje/gyb: Permission denied
~/tmp/gyb $├> file gyb
gyb: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, with debug_info, not stripped
~/tmp/gyb $├3─> which python
/bin/python
~/tmp/gyb $├> /bin/python --version
Python 3.8.12 Can anyone help isolate this further? Alternatively I'd be happy to set it up with just Python instead, if someone can point me in the right direction. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Quick update. Problem is still there I did get GYB to run from source just fine so at least backups are running again. For anyone who could come across this and needs to run this on a Synology DSM 7.1.x box in a pinch: ~/tmp $├> curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
~/tmp $├> python get-pip.py
~/tmp $├> rm get-pip.py
~/tmp $├> curl -L https://github.com/GAM-team/got-your-back/archive/refs/tags/v1.72.tar.gz --output ~/bin/gyb-python.tar.gz
~/tmp $├> tar xf ~/bin/gyb-python.tar.gz
~/tmp $├> rm ~/bin/gyb-python.tar.gz
~/tmp $├> pip install -r ~/bin/gyb-python/requirements.txt
~/tmp $├> ln -s ~/bin/gyb/client_secrets.json ~/bin/gyb-python/client_secrets.json
~/tmp $├> ln -s ~/bin/gyb/oauth2service.json ~/bin/gyb-python/oauth2service.json
~/tmp $├> ln -s ~/bin/gyb/XXXXXX.cfg ~/bin/gyb-python/XXXXXX.cfg
~/tmp $├> ln -s ~/bin/gyb/lastcheck.txt bin/gyb-python/lastcheck.txt
~/tmp $├> ln -s ~/bin/gyb/nobrowser.txt bin/gyb-python/nobrowser.txt
~/tmp $├> python ~/bin/gyb-python/gyb.py --email XXXXXX --action backup --search "newer_than:14d YMM of course, there are a few assumptions in the above, but it'll get you close if not right on target. |
Beta Was this translation helpful? Give feedback.
-
I just realized Synology DSM 7 mounts /tmp with noexec ~/tmp $├> mount | grep /tmp
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noexec) You can work around this problem. The issue comes from the fact the one of the tools GYB uses, StaticX, unpacks files to a temporary directory. There's a known issue in that library, but also a workaround offered. Since StaticX checks for the presence of an environment variable TMPDIR or defaults to /tmp you can direct where you want StaticX to unpack files before execution occurs. The workaround proof of concept ~/tmp $├> mkdir ~/.tmp
~/tmp $├> export TMPDIR=~/.tmp
~/tmp $├> ./bin/gyb/gyb
ERROR: --email is required. Success... just implement the appropriate TMPDIR in your .bashrc and you're back on track. For reference the Synology environment is ~/tmp $├> uname -a
Linux systemname 4.4.180+ #42962 SMP Fri Feb 10 16:34:59 CST 2023 x86_64 GNU/Linux synology_geminilake_420+
~/tmp $├> more /etc.defaults/VERSION | grep productversion
productversion="7.1.1" |
Beta Was this translation helpful? Give feedback.
I just realized Synology DSM 7 mounts /tmp with noexec
You can work around this problem. The issue comes from the fact the one of the tools GYB uses, StaticX, unpacks files to a temporary directory. There's a known issue in that library, but also a workaround offered. Since StaticX checks for the presence of an environment variable TMPDIR or defaults to /tmp you can direct where you want StaticX to unpack files before execution occurs.
The workaround proof of concept
Success... just implement the appropriate…