unmount a removable store automatically before xdm logout.
~/MP is the mount point for a removable store which contains
sentinel Mounted.
~$ mount | grep MP
/dev/sda1 on /home/peter/MP type ext2 (rw,nosuid,nodev,relatime,errors=continue,user_xattr,acl,user=peter)
peter@dalton:~$ ls -l MP/Mounted
-rw-rw-r-- 1 peter peter 11 May 25 15:45 MP/Mounted
This is the draft logout script.
~$ cat mylogout
cd /home/peter
if [ -e MP/Mounted ]; then
if [ "$(command lsof -Fn MP)" ]; then
# Files are open. Abort logout to allow resolution.
exit 1
ELSE
umount /home/peter/MP
# sudo is configured to allow this w/o a password.
nohup sudo /etc/init.d/xdm restart >/tmp/xdm.restart 2>&1 &
fi
fi
exit 0
Not sure that "xdm restart" should run in the background.
Any comment welcome.
Thanks, ... Peter E.
--
123456789 123456789 123456789 123456789 123456789 123456789 123456789 12
Tel +1 360 639 0202 http://carnot.yi.org/ Bcc: peter at easthope. ca
Reply to: