Re: [ubuntu-uk] Clearing home directory at logout
On 29/01/2009 23:37, Paul Sutton wrote: I thought the guest account did this, or can be set to, so I would assume if it does its a case of either: using the guest account or figuring out how it does it and reproduce for a different account Paul Doesn't look like there is a guest account on 8.04. Rob -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/
Re: [ubuntu-uk] Clearing home directory at logout
2009/1/30 Rob Beard r...@esdelle.co.uk: On 29/01/2009 23:37, Paul Sutton wrote: I thought the guest account did this, or can be set to, so I would assume if it does its a case of either: using the guest account or figuring out how it does it and reproduce for a different account Paul Doesn't look like there is a guest account on 8.04. Rob, Correct. It was added in 8.10. But maybe you could have a quick look (in a VM maybe?) and replicate the functionality for your 8.04 install? Cofion, Neil. -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/
Re: [ubuntu-uk] Clearing home directory at logout
2009/1/29 Rob Beard r...@esdelle.co.uk: Actually having a bit of a play I think I might have found a workaround. I ended up installing the GDM Watchdog which checks for when a user logs out (or alternatively turns off the client). It then closes all the users processes so in there I've put in a test command which works and runs as the logged in user. Hopefully I can put together a simple script to empty the home directory and unpack a tar archive back into the directory. Not ideal but as I'm on a tight schedule (server is being installed on Saturday and goes live on the 7th Feb) it looks like it'll have to do. I'll just have to try and find a more elegant solution afterwards. Rob, debian's LTSP package uses LDM rather than GDM to control logins. I don't know if Ubuntu is the same? Have you tested the script on the LTSP machines yet? For LDM, the LTSP howto describes different scripts that can be executed on startup, login and logout. It also has a section on customising the screensaver, which might be useful (on debian it locks the screen after a few minutes, which isn't always helpful). You might want to have a read if it turns out you are using LDM: http://www.ltsp.org/~sbalneav/LTSPManual.html#id2537250 -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/
Re: [ubuntu-uk] Clearing home directory at logout
On 30/01/2009 12:44, Lucy wrote: 2009/1/29 Rob Beardr...@esdelle.co.uk: Actually having a bit of a play I think I might have found a workaround. I ended up installing the GDM Watchdog which checks for when a user logs out (or alternatively turns off the client). It then closes all the users processes so in there I've put in a test command which works and runs as the logged in user. Hopefully I can put together a simple script to empty the home directory and unpack a tar archive back into the directory. Not ideal but as I'm on a tight schedule (server is being installed on Saturday and goes live on the 7th Feb) it looks like it'll have to do. I'll just have to try and find a more elegant solution afterwards. Rob, debian's LTSP package uses LDM rather than GDM to control logins. I don't know if Ubuntu is the same? Have you tested the script on the LTSP machines yet? Yep with the GDM Watchdog it does seem to work. I'm not sure what Ubuntu uses, I know it's LTSP 5 but I haven't really looked into it that far, last time I did anything serious with LTSP was on Debian Sarge with LTSP 4.2. For LDM, the LTSP howto describes different scripts that can be executed on startup, login and logout. It also has a section on customising the screensaver, which might be useful (on debian it locks the screen after a few minutes, which isn't always helpful). You might want to have a read if it turns out you are using LDM: http://www.ltsp.org/~sbalneav/LTSPManual.html#id2537250 Thanks I'll take a look. Rob -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/
Re: [ubuntu-uk] Clearing home directory at logout
Rob Beard wrote: On 30/01/2009 12:44, Lucy wrote: 2009/1/29 Rob Beardr...@esdelle.co.uk: Actually having a bit of a play I think I might have found a workaround. I ended up installing the GDM Watchdog which checks for when a user logs out (or alternatively turns off the client). It then closes all the users processes so in there I've put in a test command which works and runs as the logged in user. Hopefully I can put together a simple script to empty the home directory and unpack a tar archive back into the directory. Not ideal but as I'm on a tight schedule (server is being installed on Saturday and goes live on the 7th Feb) it looks like it'll have to do. I'll just have to try and find a more elegant solution afterwards. Rob, debian's LTSP package uses LDM rather than GDM to control logins. I don't know if Ubuntu is the same? Have you tested the script on the LTSP machines yet? Yep with the GDM Watchdog it does seem to work. I'm not sure what Ubuntu uses, I know it's LTSP 5 but I haven't really looked into it that far, last time I did anything serious with LTSP was on Debian Sarge with LTSP 4.2. For LDM, the LTSP howto describes different scripts that can be executed on startup, login and logout. It also has a section on customising the screensaver, which might be useful (on debian it locks the screen after a few minutes, which isn't always helpful). You might want to have a read if it turns out you are using LDM: http://www.ltsp.org/~sbalneav/LTSPManual.html#id2537250 Thanks I'll take a look. Rob Rob, come to think of it, I am sure tom brough has sorted this out with his LTSP network, as i think he auto created accounts then the data gets deleted when the session is over. Paul -- Paul Sutton www.zleap.net Support Open and ISO standard file formats ISO 26300 odf http://www.odfalliance.org Next Linux User Group meet : Feb 7th : 3pm, Shoreline Cafe Paignton -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/
Re: [ubuntu-uk] Clearing home directory at logout
Rob Beard wrote: I was wondering if anyone knew how to clear out the home directory on Ubuntu when a user logs out? See below. Public domain, do as you like. By default the script will assume the username visitor. You can pass a different username as a parameter if you wish. I use this to create a customised Gnome guest account, for when I lend my laptop to someone. I don't like Ubuntu 8.10's built-in guest account, since it presents the user with an entirely vanilla uncustomised environment. I prefer to customise the environment to make it more friendly to first-time users; for example, I have it load the Firefox browser straight away, since that's what 99% of visitors want to use. Andrew Oakley Head of Software Development Higher Education Statistics Agency (HESA) 95 Promenade, Cheltenham, Gloucestershire GL50 1HZ begin loadguest #!/bin/bash # Loadguest by Andrew Oakley www.aoakley.com public domain 2009-01-30 # # Resets the home directory back to a predetermined default # Requires saveguest to be run first # Ideal for a guest account # Default username is visitor instead of guest , since guest is used # for the built-in guest account from Ubuntu 8.10 # # Save this as /usr/local/bin/loadguest , chmod 755 # Add the following to /etc/gdm/PostLogin/Default: # if [[ $LOGNAME == visitor ]] # then # /usr/local/bin/loadguest # fi defaultusername=visitor username=$1 if [[ $username == ]] then username=$defaultusername fi if [[ -f /home/$username.tar.gz ]] then cd /home rm -rf $username/* tar xvfz /home/$username.tar.gz else echo /home/$username.tar.gz does not exist or is not a regular file fi end loadguest start saveguest #!/bin/bash # Saveguest by Andrew Oakley www.aoakley.com public domain 2009-01-30 # Saves a Gnome login session and indeed an entire home directory # MUST BE RUN AS ROOT eg. sudo saveguest # Requires loadguest # # Save this as /usr/local/sbin/saveguest , chmod 755 # Then log in as the user you wish to set up, THEN LOG OUT # Then run this as root eg. sudo saveguest defaultusername=visitor username=$1 if [[ $username == ]] then username=$defaultusername fi if [[ -d /home/$username ]] then cd /home mv -f $username.tar.gz $username-old.tar.gz tar cvfz $username.tar.gz $username --exclude=*/.thumbnails/* --exclude=*ca che* else echo /home/$username does not exist or is not a directory echo Usage: saveguest [username] echo Assumes username 'visitor' if no username supplied fi end saveguest _ Higher Education Statistics Agency Ltd (HESA) is a company limited by guarantee, registered in England at 95 Promenade Cheltenham GL50 1HZ. Registered No. 2766993. The members are Universities UK and GuildHE. Registered Charity No. 1039709. Certified to ISO 9001 and ISO 27001. HESA Services Ltd (HSL) is a wholly owned subsidiary of HESA, registered in England at the same address. Registered No. 3109219. _ This outgoing email was virus scanned for HESA by MessageLabs. _ -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/
Re: [ubuntu-uk] Clearing home directory at logout
On 30/01/2009 15:11, Paul Sutton wrote: Rob, come to think of it, I am sure tom brough has sorted this out with his LTSP network, as i think he auto created accounts then the data gets deleted when the session is over. Paul As far as I was aware it kept the data so users could access it over the internet. I'll ask him later on anyway. Rob -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/
Re: [ubuntu-uk] Clearing home directory at logout
On 30/01/2009 16:51, Andrew Oakley wrote: Rob Beard wrote: I was wondering if anyone knew how to clear out the home directory on Ubuntu when a user logs out? See below. Public domain, do as you like. By default the script will assume the username visitor. You can pass a different username as a parameter if you wish. I use this to create a customised Gnome guest account, for when I lend my laptop to someone. I don't like Ubuntu 8.10's built-in guest account, since it presents the user with an entirely vanilla uncustomised environment. I prefer to customise the environment to make it more friendly to first-time users; for example, I have it load the Firefox browser straight away, since that's what 99% of visitors want to use. Andrew Oakley Head of Software Development Higher Education Statistics Agency (HESA) 95 Promenade, Cheltenham, Gloucestershire GL50 1HZ begin loadguest #!/bin/bash # Loadguest by Andrew Oakley www.aoakley.com public domain 2009-01-30 # # Resets the home directory back to a predetermined default # Requires saveguest to be run first # Ideal for a guest account # Default username is visitor instead of guest , since guest is used # for the built-in guest account from Ubuntu 8.10 # # Save this as /usr/local/bin/loadguest , chmod 755 # Add the following to /etc/gdm/PostLogin/Default: # if [[ $LOGNAME == visitor ]] # then # /usr/local/bin/loadguest # fi defaultusername=visitor username=$1 if [[ $username == ]] then username=$defaultusername fi if [[ -f /home/$username.tar.gz ]] then cd /home rm -rf $username/* tar xvfz /home/$username.tar.gz else echo /home/$username.tar.gz does not exist or is not a regular file fi end loadguest start saveguest #!/bin/bash # Saveguest by Andrew Oakley www.aoakley.com public domain 2009-01-30 # Saves a Gnome login session and indeed an entire home directory # MUST BE RUN AS ROOT eg. sudo saveguest # Requires loadguest # # Save this as /usr/local/sbin/saveguest , chmod 755 # Then log in as the user you wish to set up, THEN LOG OUT # Then run this as root eg. sudo saveguest defaultusername=visitor username=$1 if [[ $username == ]] then username=$defaultusername fi if [[ -d /home/$username ]] then cd /home mv -f $username.tar.gz $username-old.tar.gz tar cvfz $username.tar.gz $username --exclude=*/.thumbnails/* --exclude=*ca che* else echo /home/$username does not exist or is not a directory echo Usage: saveguest [username] echo Assumes username 'visitor' if no username supplied fi end saveguest Ahh thanks Andrew, it looks like this will do exactly what I want, not sure if it work with the PostSession, I couldn't seem to get anything in PostSession to work but it should at least work with GDM Watchdog. I'll post back if I can get it working. Rob -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/
Re: [ubuntu-uk] Clearing home directory at logout
Hi Rob I presume this is for your LTSP server? Have a trawl through the LTSP LTSP discuss mailing list over on SourceForge - I seem to remember that someone had a similar problem on a Ubuntu installation just before Xmas and a work around was provided. Ian -Original Message- From: ubuntu-uk-boun...@lists.ubuntu.com [mailto:ubuntu-uk-boun...@lists.ubuntu.com]on Behalf Of Rob Beard Sent: 30 January 2009 17:16 To: British Ubuntu Talk Subject: Re: [ubuntu-uk] Clearing home directory at logout On 30/01/2009 16:51, Andrew Oakley wrote: Rob Beard wrote: I was wondering if anyone knew how to clear out the home directory on Ubuntu when a user logs out? See below. Public domain, do as you like. By default the script will assume the username visitor. You can pass a different username as a parameter if you wish. I use this to create a customised Gnome guest account, for when I lend my laptop to someone. I don't like Ubuntu 8.10's built-in guest account, since it presents the user with an entirely vanilla uncustomised environment. I prefer to customise the environment to make it more friendly to first-time users; for example, I have it load the Firefox browser straight away, since that's what 99% of visitors want to use. Andrew Oakley Head of Software Development Higher Education Statistics Agency (HESA) 95 Promenade, Cheltenham, Gloucestershire GL50 1HZ begin loadguest #!/bin/bash # Loadguest by Andrew Oakley www.aoakley.com public domain 2009-01-30 # # Resets the home directory back to a predetermined default # Requires saveguest to be run first # Ideal for a guest account # Default username is visitor instead of guest , since guest is used # for the built-in guest account from Ubuntu 8.10 # # Save this as /usr/local/bin/loadguest , chmod 755 # Add the following to /etc/gdm/PostLogin/Default: # if [[ $LOGNAME == visitor ]] # then # /usr/local/bin/loadguest # fi defaultusername=visitor username=$1 if [[ $username == ]] then username=$defaultusername fi if [[ -f /home/$username.tar.gz ]] then cd /home rm -rf $username/* tar xvfz /home/$username.tar.gz else echo /home/$username.tar.gz does not exist or is not a regular file fi end loadguest start saveguest #!/bin/bash # Saveguest by Andrew Oakley www.aoakley.com public domain 2009-01-30 # Saves a Gnome login session and indeed an entire home directory # MUST BE RUN AS ROOT eg. sudo saveguest # Requires loadguest # # Save this as /usr/local/sbin/saveguest , chmod 755 # Then log in as the user you wish to set up, THEN LOG OUT # Then run this as root eg. sudo saveguest defaultusername=visitor username=$1 if [[ $username == ]] then username=$defaultusername fi if [[ -d /home/$username ]] then cd /home mv -f $username.tar.gz $username-old.tar.gz tar cvfz $username.tar.gz $username --exclude=*/.thumbnails/* --exclude=*ca che* else echo /home/$username does not exist or is not a directory echo Usage: saveguest [username] echo Assumes username 'visitor' if no username supplied fi end saveguest Ahh thanks Andrew, it looks like this will do exactly what I want, not sure if it work with the PostSession, I couldn't seem to get anything in PostSession to work but it should at least work with GDM Watchdog. I'll post back if I can get it working. Rob -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/ -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/
Re: [ubuntu-uk] Clearing home directory at logout
On 30/01/2009 20:40, Ian Pascoe wrote: Hi Rob I presume this is for your LTSP server? Have a trawl through the LTSPLTSP discuss mailing list over on SourceForge - I seem to remember that someone had a similar problem on a Ubuntu installation just before Xmas and a work around was provided. Ian Yep, unfortunately they want normal users who keep their settings and some guest accounts. I'll have a look at that too. Thanks for the pointers. Assuming all goes well tomorrow getting the server in I'll send out an e-mail inviting anyone who wants to come along to the big official opening :-) Rob -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/
Re: [ubuntu-uk] Clearing home directory at logout
2009/1/30 Andrew Oakley andrew.oak...@hesa.ac.uk: [snip] Public domain, do as you like. Slight bash optimisation included below... [snip] username=$1 if [[ $username == ]] then username=$defaultusername fi username=${1:-${defaultusername}} This single line replaces both the assignment and the 'if..fi' block. The unfortunate bit about this replacement is that no one understands it without reading the bash man page! :-) Cofion/Regards, Neil. -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/
Re: [ubuntu-uk] Clearing home directory at logout
On Thu, 2009-01-29 at 21:38 +, Rob Beard wrote: Hi folks, I was wondering if anyone knew how to clear out the home directory on Ubuntu when a user logs out? Basically what I to achieve is have a script run to automatically when a user logs out of their Gnome session so it resets everything back to the default. I've tried putting a couple of commands into .bash_logout to see it that works but it doesn't seem to run on a Gnome session logout. I just wondered if anyone knew how I could specify a script to run at logout for specific users? Ta, Rob i tried that once before - i basically made their home directory a folder in the /tmp directory. That worked... but then the new powermanager/user switcher-y thing instead of the shutdown button has a guest session in it. Not sure how to access that from gdm though... === Farran Lee I'm only 16 :P -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/
Re: [ubuntu-uk] Clearing home directory at logout
On 29/01/2009 21:49, Farran Lee wrote: i tried that once before - i basically made their home directory a folder in the /tmp directory. That worked... but then the new powermanager/user switcher-y thing instead of the shutdown button has a guest session in it. Not sure how to access that from gdm though... Actually having a bit of a play I think I might have found a workaround. I ended up installing the GDM Watchdog which checks for when a user logs out (or alternatively turns off the client). It then closes all the users processes so in there I've put in a test command which works and runs as the logged in user. Hopefully I can put together a simple script to empty the home directory and unpack a tar archive back into the directory. Not ideal but as I'm on a tight schedule (server is being installed on Saturday and goes live on the 7th Feb) it looks like it'll have to do. I'll just have to try and find a more elegant solution afterwards. Still I'm sure it'll all be worth it in the end when there are 6 more Ubuntu machines out there :-) Rob -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/
Re: [ubuntu-uk] Clearing home directory at logout
Not sure about clearing it on logout, but i expect clearing it on login will do? SystemPrefsSessions AddCommand: rm -fr $HOME/* ; cp /etc/skel/* $HOME/ That deletes everyhting in the come dir and then copies the default home dir 2009/1/29 Rob Beard r...@esdelle.co.uk Hi folks, I was wondering if anyone knew how to clear out the home directory on Ubuntu when a user logs out? Basically what I to achieve is have a script run to automatically when a user logs out of their Gnome session so it resets everything back to the default. I've tried putting a couple of commands into .bash_logout to see it that works but it doesn't seem to run on a Gnome session logout. I just wondered if anyone knew how I could specify a script to run at logout for specific users? Ta, Rob -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/ -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/
Re: [ubuntu-uk] Clearing home directory at logout
*come=home sorry 2009/1/29 Alec Wright ale...@gmail.com Not sure about clearing it on logout, but i expect clearing it on login will do? SystemPrefsSessions AddCommand: rm -fr $HOME/* ; cp /etc/skel/* $HOME/ That deletes everyhting in the come dir and then copies the default home dir 2009/1/29 Rob Beard r...@esdelle.co.uk Hi folks, I was wondering if anyone knew how to clear out the home directory on Ubuntu when a user logs out? Basically what I to achieve is have a script run to automatically when a user logs out of their Gnome session so it resets everything back to the default. I've tried putting a couple of commands into .bash_logout to see it that works but it doesn't seem to run on a Gnome session logout. I just wondered if anyone knew how I could specify a script to run at logout for specific users? Ta, Rob -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/ -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/
Re: [ubuntu-uk] Clearing home directory at logout
Farran Lee wrote: On Thu, 2009-01-29 at 21:38 +, Rob Beard wrote: Hi folks, I was wondering if anyone knew how to clear out the home directory on Ubuntu when a user logs out? Basically what I to achieve is have a script run to automatically when a user logs out of their Gnome session so it resets everything back to the default. I've tried putting a couple of commands into .bash_logout to see it that works but it doesn't seem to run on a Gnome session logout. I just wondered if anyone knew how I could specify a script to run at logout for specific users? Ta, Rob i tried that once before - i basically made their home directory a folder in the /tmp directory. That worked... but then the new powermanager/user switcher-y thing instead of the shutdown button has a guest session in it. Not sure how to access that from gdm though... === Farran Lee I'm only 16 :P I thought the guest account did this, or can be set to, so I would assume if it does its a case of either: using the guest account or figuring out how it does it and reproduce for a different account Paul -- Paul Sutton www.zleap.net Support Open and ISO standard file formats ISO 26300 odf http://www.odfalliance.org Next Linux User Group meet : Feb 7th : 3pm, Shoreline Cafe Paignton -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/