screen is a utility available on Linux that create virtual terminals.

In practice, it enables user to run command on a remote device (ie. typically via a SSH session) that will continue running even if the connection is interrupted.

Screen is broken on QNAP TS-253E

Unfortunately, by default (tested right after installation), screen doesn't work on QNAP systems (tested on QTS 5.0 and QTS 5.1).

When running screen, it fails with an error such as

# screen
/var/run/utmp: No such file or directory
Cannot find termcap entry for 'xterm-256color'

Fix screen

Create the missing file and some symlinks.

touch /var/run/utmp
ln -s /usr/share/terminfo/x/xterm-xfree86 /usr/share/terminfo/x/xterm-256color
ln -s /usr/share/terminfo/x/xterm-xfree86 /usr/share/terminfo/x/xterm-color

Alternative fix

Rather than create symlinks, one can make screen use existing termcap entry with the env variable TERMINFO.

TERMINFO='/usr/share/terminfo/' screen

However, this solution has proven more cumbersome and less reliable.