Running a script after log off in Ubuntu

Perhaps bit of a hack I but could not find another way of unmounting Samba shares automatically before my user session ends. If I do not unmount them myself, they would stay mounted after network manager has shutdown making Ubuntu hang. So to overcome this problem, I’ve done the following:

$ cd /etc/gdm/PostSession
$ sudo vi Default

add your commands before “exit 0″, for example:

...
sudo fusermount -u /home/juraj/shareA/
sudo fusermount -u /home/juraj/shareB/
exit 0

Save (:wq) and give it a go - restart or logoff. Tested in Ubuntu 8.10

  1. No comments yet.

You must be logged in to post a comment.

  1. No trackbacks yet.

SetPageWidth