Fedora 28 wakes immediately after suspend [solution]

In Fedora 28 on my Dell Precision laptop, when I close the lid, the suspension starts, but the laptop wakes up almost immediately, so I cannot suspend properly.

The problem is that BlueTooth is causing the laptop to ignore the suspend signal. This is easily fixed with the following workaround.

  1. Turn on bluetooth and type ‘lsusb’. In my case I see this

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 007: ID 8087:0a2b Intel Corp.
Bus 001 Device 004: ID 0bda:5650 Realtek Semiconductor Corp.
Bus 001 Device 003: ID 0a5c:5834 Broadcom Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Now turn off Bluetooth and again type ‘lsusb’. Now I see this

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 0bda:5650 Realtek Semiconductor Corp.
Bus 001 Device 003: ID 0a5c:5834 Broadcom Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

So from this, I know that the USB device is vendor 8087 and product 0a2b. I need these values for the next step.

Now create a file called /usr/local/bin/bluetooth-sleep and in it, paste this :-

!/bin/bash
Disable bluetooth given first argument “start”
Re-enable bluetooth given first argument “stop”
Expects vendor and product as sedond and 3rd arguments
set -eu
usage() {
script_name=”/usr/local/bin/bluetooth-sleep”
printf ‘%s: de-authorise bluetooth during sleep/suspend\n’ “$script_name” >&2
printf ‘Usage: %s (start|stop) \n’ “$script_name” >&2
exit 1
}
case “${1:-}” in
start) value=0 ;;
stop) value=1 ;;
*) usage ;;
esac
[ $# -ne 3 ] && usage
vendor=$2
product=$3
shopt -s nullglob
for dir in /sys/bus/usb/devices/*; do
if [[ -L “$dir” && -f $dir/idVendor && -f $dir/idProduct &&
$(cat “$dir/idVendor”) == “$vendor” &&
$(cat “$dir/idProduct”) == “$product” ]] ; then
echo “$value” > “$dir/authorized”
echo “echo $value > $dir/authorized”
fi
done

Next, create a file called /etc/systemd/system/bluetooth-disable-before-sleep.service

In it, paste this :-

[Unit]
Description=disable bluetooth for system sleep/suspend targets
Before=sleep.target
Before=suspend.target
Before=hybrid-sleep.target
Before=suspend-then-hybernate.target
StopWhenUnneeded=yes
[Service]
Type=oneshot
RemainAfterExit=yes
Usage: blootooth-sleep (start|stop)
Get values from lsusb
eq: Bus 001 Device 003: ID 8087 0a2b Intel Corp
Usage: bluetooth-sleep (start|stop) 8087 0a2b
ExecStart=/usr/local/bin/bluetooth-sleep start 8087 0a2b
ExecStop= /usr/local/bin/bluetooth-sleep stop 8087 0a2b
[Install]
WantedBy=sleep.target
WantedBy=suspend.target
WantedBy=hybrid-sleep.target
WantedBy=suspend-then-hibernate.target

Note that the values used in this second file include 8087 and 0a2b which relate to the bluetooth device connected to the internal usb hub (it is not a plugin usb device).

The final step is to enable the new service

systemctl enable bluetooth-disable-before-sleep.service

You should be able to turn off bluetooth by running :-

/usr/local/bin/bluetooth-sleep start 8087 0a2b

and turn it on again by running :-

/usr/local/bin/bluetooth-sleep stop 8087 0a2b

And now that you have started the systemctl process, closing your laptop lid should first turn off bluetooth and then suspend. The suspend should now work. And when you open the laptop, the bluetooth should restart.

I hope it works for you.

Disable “tracker” in Fedora

Update- Disabling tracker also disables Samba. This is needed by my Xerox Versalink C405 printer for scanning documents directly from the printer to my Linux machine.

A note on the Versalink C405. I have owned a number of printers, mostly HP, and this Xerox printer outperforms every other printer that I have ever owned. I would never buy HP again.

Tracker is a background Linux task that catalogues your disk. It can be a disk hog. To disable it, do the following.

  1. Copy the autostart file and override it with a user-specific one: $ cp /etc/xdg/autostart/tracker-store.desktop ~/.config/autostart/tracker-store.desktop
    and append to it:
    Hidden=true
    (The same step also applies for tracker’s friends, such as tracker-miner-fs, etc.)
  2. Mask (which is the strongest yet nondestructive way to “disable” a static systemd service completely [4]) all tracker-related services:
        $ systemctl --user mask tracker-store

Thanks to https://www.soimort.org/notes/171103/ for this information.

PKI Card on VMWare Horizon Client running Fedora 28

First, ensure that you have the correct version of vmware-horizon-client working. I installed release 4.7 but it did not work properly. Release 4.7 seems fine. To remove vmware-horizon-client, go to the install script and run as root:-

./VMware-Horizon-Client-x.x.x-yyyyyyy.arch.bundle -u vmware-horizon-client

Now install release 4.7

Next, you need to make some changes to allow the smartcard to work as described in the vmware horizon client instructions. The problem is that this libgtop11dotnet.so library is not in the Fedora repository so clone it from here :-

git clone https://github.com/AbigailBuccaneer/libgtop11dotnet.git
dnf install pcsc-lite
dnf install pcsc-lite-devel

cd libtop11dotnet
./configure
Now edit Makefile and find CXXFLAGS. Add -std=c++03 to the CXXFLAGS

Next, on line 28 of MiniDriverContainerMapFile.hpp, change boost.hpp to boost_array.hpp as follows :-

#include <boost/serialization/boost_array.hpp>

Now run “make”. It should complete and you will then get the file ./.libs/libgtop11dotnet.so.0.0.0 and a soft-link to this from libgtop11dotnet.so

I copied libgtop11dotnet.so to /usr/lib64/libgtop11dotnet.so

Procedure
1 Create the folder /usr/lib/vmware/view/pkcs11.
2  ln -s /usr/lib64/libgtop11dotnet.so  /usr/lib/vmware/view/pkcs11

 

 

 

Linux machine (Fedora) restarted immediately after suspend

My Dell Laptop restarted immediately after suspend when using Fedora 28  (Linux). To debug this, I used the following commands :

  1. systemd-inhibit –list        – This shows the programs that can inhibit suspending the system.
  2. systemctl suspend                – Request a suspend. Similar to closing the laptop lid.
  3. systemctl suspend -i           – Override inhibit and suspend, preventing programs that are inhibiting suspend from being able to inhibit.

I found that I could kill off processes listed by (1) and see which one was causing problems. In my case the xfce4-power-manager was the culprett

 

NetworkManager and nm-applet not working properly with xfce4 window manager

Symptom

When running xfce4, I found that in the notifications area, the nm-applet (the applet that shows the network status) would sometimes take a while to arrive, and sometimes it would hang and not allow me to view or change network.

When I started xfce4-notifyd-config I noticed that the xfce4-notifyd daemon was not running.

Solution

It turned out that I had some kde utilities installed, and one of these, the org.kde.plasma.Notifications.service, was conflicting with the org.xfce.xfce4-notifyd.Notifications.service. Both notification services failed.

To solve the problem, simply remove /usr/share/dbus-1/services/org.kde.plasma.Notifications.service (ensuring first that /usr/share/dbus-1/services/org.xfce.xfce4-notifyd.Notifications.service exists).

Now log out and log in again and you should find that the nm-applet works and that when you start xfce4-notifyd-config, you don’t get the message that the daemon has not started.

I could not log in as myself but could log in as root on Fedora 28. Dropbox failed to start.

The symptom is that at the login screen I was unable to login as myself, but I could log in as other users or as root.

The problem turned out to be that the root partition (“/”) was full. To solve the problem I logged in as root and went to /var/log/journal/257adc6a3c2544e98cae7eeea8f97e6e and removed the files in the journal.

After rebooting the machine I was again able to login as myself. I noticed that Dropbox, which had been complaining that it was not able to start, is now able to start again.

Thunderbird won’t work with the master password

I found that Thunderbird failed to connect to send or receive email and constantly asked for the master password. To fix this, I removed the key3.db and sighons.sqlite files in the profile (within ~/.thunderbird), restarted Thunderbird, then went into the Edit->Preferences->Security window where I turned off “Use a master password”. Close the form, reopen the same form and turn on “Use a master password” again, and enter the password.

I found out later that the problem reoccurred but starting thunderbird in safe-mode (thunderbird –safe-mode) and disabling offending add-ons fixes the problem

Now everything works.

Cisco Anyconnect problem on Fedora 28

When trying to get Anyconnect VPN working after upgrading from Fedora 26 to Fedora 28, vpnui hung up and refused to connect. The solution was to copy the /lib/libstdc++.so.6 file from Fedora 26 an put it in ~/.cisco/hostscan/lib and then it ran fine. I did this for the root user as well.

10 October 2018 – Update

Bugzilla report http://bugzilla.redhat.com/show_bug.cgi?id=1576910 shows a problem with NetworkManager and its interaction with Anyconnect. I can now confirm that uninstalling NetworkManager-config-connectivity-fedora seems to make Anyconnect stable on Fedora 28 with Anyconnect version 4.603049

Adding a Xerox Versaprint c405 printer to Fedora Linux 28 and Centos 7

UPDATE: I found that xeroxprtmgr utility did not work on Fedora 28.
To fix the problem you need to get a the /usr/lib64/libstdc++.so.6 from
an older RedHat version (such as Centos6) and put it into /opt/Xerox/prtsys/v5lib directory. With this done, everything works fine.

Here is the file if you need it. versalink_file.tar
To get the file, you need to untar the versalink_file.tar.gz file as follows
gtar xvf versalink.tar.gz. One file will emerge, this being libstdc++.so.6.
Just copy this to /opt/Xerox/prtsys/v5lib. I had to tar it up because WordPress would not allow it in its raw form for security reasons.

——–

To add the versaprint c405 printer/copier/scanner MFP device, you cannot use CUPS, but instead should download the rpm from Xerox and run (as root) the xeroxprtmgr utility, which will install the drivers and enable printing.

Strangely, by default the Linux system does not read toner quantity or other features like duplexing ability from the printer. You have to log in using the xeroxprtmgr utility (from the Xerox RPM file), select the printer, go to Queue Preferences->Configuration->Installable-Options, and enable the duplexer. Then go to “Configuration->Bi-Directional-Setup and turn it on. Type in the ip-address of the printer (I have it set static). Now you will see the toner levels. Finally, go to Paper/Output->Paper and select A4, Paper/Output->2-sided-printing->2-Sided-Print and lastly Paper/Output->Print Quality->Enhanced. Down below, don’t click save, just select OK.

You must not disable tracker and its friends (tracker-store etc) if you want to run Samba, and you need Samba running if you want to be able to scan from the Versalink 405 scanner directly to your Linux machine.

I created a Samba share called XEROX. You can view your shares as follows:

[root@myMachine]# smbclient -L localhost

Sharename Type Comment
--------- ---- -------
XEROX     Disk 
IPC$      IPC   IPC Service (Samba 4.8.8)
Reconnecting with SMB1 for workgroup listing.

Server Comment
--------- -------

Workgroup Master
--------- -------
SCANNER OSTRIC

 

Centos 7

When it comes to installing the Versalink software on Centos-7, I found that the new software provided by Xerox had the wrong version of glibc++ and even substituting glibc++ from Centos 6 did not work. I found that the solution was to use an earlier version of the Xerox software Xeroxv5Pkg-Linuxx86_64-5.20.626.4179.rpm