PAM Script to Turn off auto screen-lock in Gnome Shell

gnome-logo2

Update: I’ve created a new version of this script that can be run by NetworkManager, turning Gnome screensaver auto-lock on or off as the wireless essid changes.

In Linux, we have Pluggable Authentication Modules and various applications use PAM to authenticate users. Marco Ditri posted about using PAM to run a script that would prevent xscreensaver from locking the screen on his laptop when connected to his home wireless network.

I wanted to do the same in Gnome, so I’ve modified Marco’s script to use gsettings to disable Gnome Shell auto screen-lock when authenticated to particular wireless networks and enable it everywhere else. You’ll find comments in the script on how to incorporate it in your local PAM configuration.

https://gist.github.com/steveblamey/11344909

Evince on NFS Kills Ubuntu Desktop

Fortress of Solitude

All the PCs here at the Fortress of Solitude run Ubuntu, so when I installed a new server it made sense to use NFS for file-sharing. I made that decision because NFS just works and is much easier to set-up than Samba Windows CIFS.

Everything worked well except for two bugs:

  1. Ubuntu Unity 2D would crash
  2. Viewing directories that contained many PDF files would freeze the desktop
The first bug had a fairly easy workaround but it took longer to track down a solution for the second. Of course, I would have found the source of the problem more quickly if I had just looked at the log on my client PC!:
[...] apparmor="DENIED" operation="sendmsg" parent=1 profile="/usr/bin/evince-thumbnailer" [...]
[...] kernel: [  708.816888] nfs: RPC call returned error 13

In other words, the evince-thumbnailer cannot create thumbnail previews for pdf documents because it is being denied access to the network by AppArmor. Which leads us to Ubuntu Bug #778638 where a fix has been released. See the bug report for the fix that can be applied manually or by installing updated Evince software packages from the Ubuntu Natty Proposed repository.

Microsoft Outlook and Network Stored PST Files Don’t Work

2331008356

I was recently called out to a new client site to stop a Microsoft Outlook 2010 client from crashing every time email was sent or received. It took a while to discover the cause of the problem because the issue was related to a configuration that has not been supported by Microsoft since Exchange Server 5.0 was released in 1997. So, not something I’d expect to find anyone still using.

Don’t Store PST files on a network share

According to Microsoft, among the consequences of using a network share to store pst files are:

When you store .pst files [on a network share], shares may stop responding. This behavior may cause several client-side problems, such as causing Outlook to stop responding or freezing desktops on client computers.

There is some further information and analysis over on the technet blog, including additional problems caused on the server side, from way back in 2007!

Hopefully this information will jog the memory of future troubleshooters or give them another place to look when trying to solve problems with Microsoft Outlook.

Using SSH to Forward a Remote Port Locally

A recent job reminded me that ssh can be used to forward a port on a remote system to one on the local client machine, like so:

ssh -L 8000:localhost:80 username@remoteserver

In that example, I could now visit http://localhost:8000 in a web browser to access the remote web server over the ssh connection. This is useful for troubleshooting or setting up services before allowing public access.