Etikettarkiv: restart

Sleep resume in Ubuntu screws up mouse pad

I found that my Lenovo laptops did not always get the mousepad right when coming out of sleep or hibernate. After a bit of research I found that a modprobe remove and insert of the psmouse kernel module did the trick.

To automatize this you can insert a file in the systemd control structure to fix the problem yourself (if you are experiencing it). Below is a block of code. Save this to a file in /lib/systemd/system-sleep/touchpad


#!/bin/bash
# 2019 Täpp-Anders Sikvall
# Reinsert kernel module for mouse pad on lenovo after waking up
# from a sleep or a suspend so that things like gestures work 
# properly
# bugs to anders@sikvall.se
 
case "$1" in
   pre)
     exit 0                  # Do nothing just return
     ;;
   post)
     sleep 3                 # Wait for system to stabilize
     modprobe -r psmouse     # Remove psmouse from kernel
     modprobe psmouse        # Reinsert psmouse to kernel
     exit 0                  # Return no error
     ;;
   *)
     exit 1                  # Normally we should not be here
     ;;                      # but if we are, return error
 esac

Samba does not start on boot in my Linux

Remember you can always check the status of samba using the commands

# service smbd status
# service nmbd status

I found that they where running and started as they should but still did not accept connections. The bind interfaces in my samba.conf file is the interfaces rather than the ip address but it does not seem to solve the problem. However restarting samba did solve the problem and I nailed it down to the ”Samba IP sensitivity problem”.

Samba really does not like when you use DHCP for the server and even if you set it up so that it always gets the same IP from the DHCP server it does not matter, Samba does not like it.

The simple solution to this is to add the two following lines to the last part of /etc/rc.local which is the script that runs last upon boot.

service smbd restart
service nmbd restart

However, also changing your networking setup to fixed IP generally works well, this is in case you do not want to do that or can’t do that.

Another way would be to change it to the dhcp lease script so when the samba server gets a new lease, an automatic restart of the related daemons happen. However, that would also interrupt any service being served at the moment and break long file transfers or streams. I would therefore advice against it.

The best solution so far is to use a fixed IP. The above workaround is a kludge. You have been warned.