CentOS – GNU Screen refuse to start on non-root user

After a system upgrade, I couln’t start anymore screen as a regular user, only as root.

After a system upgrade, I couln’t start anymore screen as a regular user, only as root. Which is not okay…

Usually I’ve had trouble with wrong permission on /dev/pts/ but not here, screen justs silently exit.

[user@nsxxxxx ~]$
[user@nsxxxxx ~]$ screen
[screen is terminating]
[user@nsxxxxx ~]$
[user@nsxxxxx ~]$

After a lot of strace and duckduckgoing around, I found that it was due to the mount parameters in /etc/fstab

To test, I’ve just commented the entry in /etc/fstab and reloaded my server

[root@nsxxxxx ~]# mount | grep devpts
devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000)
[root@nsxxxxx ~]#
[root@nsxxxxx ~]#

Permission are not okay, and most importantly, the GID is not set to the TTY group ( 5 )

[root@nsxxxxx ~]# cat /etc/fstab
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/md2 / ext4 errors=remount-ro 0 1
/dev/md3 /home ext4 defaults 1 2
/dev/sda4 swap swap defaults 0 0
/dev/sdb4 swap swap defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
#devpts /dev/pts devpts defaults 0 0  <<<<<< Commented entry
[root@nsxxxxx ~]#

After a reload ( probably a remount should/could work ? )

[root@nsxxxxx ~]#
[root@nsxxxxx ~]# mount | grep pts
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)[root@nsxxxxx ~]#

From my understanding, screen needs to allocate PTS for the user. That can be done if the process is owned by TTY group ( and the permission set accordingly  )

[root@nsxxxxx ~]# cat /etc/group | grep tty
tty:x:5:

Practical example of slackware package install logs

Here is a short discovery topic of how you can use the slackware package install logs for troubleshooting.
This is a practical example, used to tshoot an issue with LibreOffice ( disclaimer, it’s – as usual – a user mistake )

Howdy,

Today got some trouble with LibreOffice ( or libreoffice ? ), I couln’t start it anymore.

$ libreoffice 
/usr/lib64/libreoffice/program/oosplash: error while loading shared libraries: libboost_system.so.1.63.0: cannot open shared object file: No such file or directory

I first though about lib issue, as the error states…and libboost, as you can see, it is really missing.

$ ldd /usr/lib64/libreoffice/program/oosplash
	linux-vdso.so.1 (0x00007ffdfd31f000)
	libboost_system.so.1.63.0 => not found <<<<<<<<<<< MISSING !
	libXinerama.so.1 => /usr/lib64/libXinerama.so.1 (0x00007f2f011ce000)
	libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007f2f00e92000)
	libpng16.so.16 => /usr/lib64/libpng16.so.16 (0x00007f2f00c5f000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f2f008c4000)
	libuno_sal.so.3 => /usr/lib64/libreoffice/program/libuno_sal.so.3 (0x00007f2f00667000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f2f0027d000)
	libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007f2f0006b000)
	libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007f2effe45000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007f2effc41000)
	libz.so.1 => /lib64/libz.so.1 (0x00007f2effa2a000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f2f013d1000)
	libboost_system.so.1.63.0 => not found
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f2eff80b000)
	librt.so.1 => /lib64/librt.so.1 (0x00007f2eff603000)
	libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f2eff27c000)
	libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007f2eff065000)
	libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007f2efee61000)
	libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 (0x00007f2efec5b000)

My system is running  the boost 1.67 ( not 1.63 ). I thought it was probably due to a package compiled at a point in time… then the lib has been upgraded so I needed to recompile the package.

# slackpkg search boost
Looking for boost in package list. Please wait... DONE

The list below shows all packages with name matching "boost".

[ installed ] - boost-1.67.0-x86_64-1

You can search specific files using "slackpkg file-search file"

Then I realised that it’s weird that libreoffice is pointing to  /usr/lib64/libreoffice/. libreoffice is installed usually in /opt

When trying to reinstall the libreoffice6.0 package, I found an interresting output:

 # removepkg libreoffice

Removing package /var/log/packages/libreoffice-6.0.3-x86_64-1_SBo...
Removing files:
  --> /usr/bin/lobase (symlink) was found in another package. Skipping.
  --> /usr/bin/localc (symlink) was found in another package. Skipping.
  --> /usr/bin/lodraw (symlink) was found in another package. Skipping.
  --> /usr/bin/loimpress (symlink) was found in another package. Skipping.
  --> /usr/bin/lomath (symlink) was found in another package. Skipping.
  --> /usr/bin/lowriter (symlink) was found in another package. Skipping.
  --> /usr/bin/soffice (symlink) was found in another package. Skipping.
  --> /usr/bin/unopkg (symlink) was found in another package. Skipping.
  --> Deleting symlink /usr/bin/libreoffice6.0
  --> Deleting symlink /usr/bin/sbase

Bins are skipped, due due to being present in another package, which is odd.

Here I remember that Slackware keeps the logs of the package installation, in /var/log/packages

# cd /var/log/packages/
:/var/log/packages # 
:/var/log/packages # 
:/var/log/packages # 
:/var/log/packages # grep -R /usr/bin/lobase *
:/var/log/packages # grep -R lobase *
LibreOffice-5.3.3.2-x86_64-2_SBo:usr/bin/lobase
LibreOffice-5.3.3.2-x86_64-2_SBo:usr/man/man1/lobase.1.gz

Bingo, it just seems that I’ve installed somehow 2 version of libreoffice at some point. Note the typo difference, one package is calle libreoffice, the other LibreOffice.

Both version came from https://slackbuilds.org :

  • libreoffice is the package you can build using the full source of the project, while
  • LibreOffice is a re-package of the official/upstream RPM package

After removing the LibreOffice and libreoffice , then properly reinstall libreoffice6. Everything was fine !