0

I'm trying to setup a background job in a QNAP TVS-871T.

It doesn't come with nohup pre-installed.

I've found multiple references to install it on a QNAP device (e.g. https://stackoverflow.com/questions/28623838/qnap-nas-nohup-no-such-file-or-directory) but that doesn't seem to apply to this device; there is no such package available in the web interface.

Seems to be a variant of an Ubuntu distro but none of its package managers are available.

cat /proc/version
Linux version 3.12.6 (root@NasX86Builder) (gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)) #1 SMP Wed Jun 1 06:14:19 CST 2016

It's running QTS 4.2 if that makes any difference.

Any idea?

Ben
  • 367
  • 3
  • 21

2 Answers2

1
  1. Install entware-ng (opkg) From QNAP Forums
wget -O - http://entware.zyxmon.org/binaries/other/qnapware-to-entware-ng.sh | /bin/sh
  1. Open profile with VIM
vi /etc/profile
  1. In VIM:

    1. Press i to begin VIM 'insert'
    2. find "PATH"
    3. Add /opt/bin to $PATH variable before /usr/bin
    4. Save by typing :wq and press enter
  2. Back in your console now, execute:

source /etc/profile
  1. Test that opkg works:
opkg -h
  1. Update opkg and install coreutils
opkg update
opkg install coreutils
  1. Restart your NAS

  2. Run nohup

nohup echo "QNAP makes everything too difficult, RIP."

Note: I know of no other way to access the packages installed by opkg, it doesn't find nohup without a restart. Let me know if you know the solution because it would be great to know

Sandwich
  • 111
  • 3
1

Does the package manager not provide coreutils/nohup?

http://blog.kiel.com.au/2012/04/installing-custom-packages-like.html

First you need to install ipkg - In the device's Administration interface, select the 'System Tools' -> 'QPKG' page, click on 'Get QPKG' button.

Once done login to your server via SSH and 'ipkg install sed' you can basically use this to install most packages that for linux.

In the absence of package management, you would have to install a binary.

  1. If you're lucky, you could figure out what Ubuntu/Debian version is most compatible with your OS and install the nohup binary by copying it into your path (/usr/bin/nohup on Ubuntu 16.04).
  2. If you have no such luck getting it to run due to some shared library dependency issue or whatever, you could build a binary for your QNAP that is statically linked so that it has no shared library dependencies. On Debian/Ubuntu it's in the coreutils package.

Chances are you'll get it working - it may have little or no dependencies. Try the above steps and if they don't work post the details in your question and we'll try again.

I think this means you will probably be OK to copy a binary over from another system with libc6 of the same architecture (x86_64 for you I think)

$ readelf -d /usr/bin/nohup

Dynamic section at offset 0x6e28 contains 24 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000000c (INIT)               0x401240
 0x000000000000000d (FINI)               0x404dfc
 0x0000000000000019 (INIT_ARRAY)         0x606e10
 0x000000000000001b (INIT_ARRAYSZ)       8 (bytes)
 0x000000000000001a (FINI_ARRAY)         0x606e18
 0x000000000000001c (FINI_ARRAYSZ)       8 (bytes)
 0x000000006ffffef5 (GNU_HASH)           0x400298
 0x0000000000000005 (STRTAB)             0x4008f8
 0x0000000000000006 (SYMTAB)             0x4002e0
 0x000000000000000a (STRSZ)              659 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000015 (DEBUG)              0x0
 0x0000000000000003 (PLTGOT)             0x607000
 0x0000000000000002 (PLTRELSZ)           1320 (bytes)
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000017 (JMPREL)             0x400d18
 0x0000000000000007 (RELA)               0x400c70
 0x0000000000000008 (RELASZ)             168 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000006ffffffe (VERNEED)            0x400c10
 0x000000006fffffff (VERNEEDNUM)         1
 0x000000006ffffff0 (VERSYM)             0x400b8c
 0x0000000000000000 (NULL)               0x0
Ryan Babchishin
  • 6,160
  • 2
  • 16
  • 36
  • Thanks for your input on this. I was hoping not to have to manually do this. There's no System Tools or QPKG option in the QNAP device I have unfortunately. – Ben Jul 29 '16 at 04:20
  • @Ben Copying one file from another computer is pretty simple. Give it a try. Do you have another Linux system? – Ryan Babchishin Jul 29 '16 at 04:22
  • I could provision a VM for that purpose.. bit overkill for something that should be so simple. I might send a request to QNAP.. – Ben Jul 29 '16 at 04:29
  • QNAP support was pretty quick to get back to me. There is no way to do this with a standard QNAP option. I guess the copy from another machine that Ryan suggest would be the only way to go. – Ben Jul 29 '16 at 05:46
  • @Ben If it's not against the rules, this should save you some time: https://drive.google.com/open?id=0B4TsFmlkMu_feWtyZFJKME1pRkU `nohup` from Ubuntu 16.04 x64 – Ryan Babchishin Jul 29 '16 at 06:06
  • Thanks Ryan, it's generous, but I'm not installing a 3rd party binary downloaded from a seemingly helpful but unknown person.. I'm sure you can understand why. – Ben Jul 29 '16 at 06:53
  • @Ben Sure, you can get it here: http://mirrors.kernel.org/ubuntu/pool/main/c/coreutils/coreutils_8.25-2ubuntu2_amd64.deb but you'll have to get something for your OS to extract it. DEB files are "AR" archives, with optionally compressed tar archives inside. It looks like 7-Zip might work if you are using Windows. – Ryan Babchishin Jul 29 '16 at 07:21