Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
So, I'm wondering. Can I have a script run on startup that will copy ALL the contents of the user's all profile from some backup folder to the /home/all folder? Before anyone logs in?
I'm using Xandros OC3.
If anyone knows of any other Deepfreeze-like solution, I'm open ears!
Distribution: Debian Squeeze. Various live CD's Win7
Posts: 346
Rep:
Interested in this myself. Assuming you want to wipe out all user activity from
previous sessions and restore to a pristine condition. Looking at kdar and init script modification myself but haven't started testing this idea at all. Kdar is VERY fast.
I'm not sure exactly what you're wanting to accomplish. Something where a user can change all kinds of stuff, but then everything is restored back to its original state on reboot?
A shot in the dark here - you might look into unionfs. Here's one article on it:
Distribution: Debian Squeeze. Various live CD's Win7
Posts: 346
Rep:
Yes. Such as for a public access computer in a library etc. where any stored information or hacking attempts are wiped away quickly and setup restored like new.
Won't be saying anything more for a while as I will be busy reading,thinking,doing, testing, but will report back if needed and I find anything useful. I find LQ helps me with other stuff when I'm looking for information on something else. Love it!
haertig: Well, I'm going to lock down much of it via the Kiosk Admin tool, but some things may still be hackable, so I'd like the all user account (/home/all) entirely wiped out and restored from an account backup folder somewhere else on reboot. Where would I put such a script to do this on reboot (before anyone logs in)?
Where would I put such a script to do this on reboot (before anyone logs in)?
I haven't tried to implement something like you're doing so I can't tell you the specifics. I just saw your post title "DeepFreeze" and immediately thought "unionfs". Not that I've actually used unionfs outside of Knoppix. I just know it exists.
Depending on all the things your kiosk needs to do, you might be able to get by creating a customized version of Knoppix on a CD (or DVD if you need more space). Boot off of that and forget about the harddisk entirely. Alternately, you can use the harddisk for user data storage only - but protect the OS by running it off of the CD/DVD. Put enough ram in your kiosk and you can load Knoppix totally into ram so you don't have the slowdown of reading programs from the CD. Boot with "knoppix toram" for this functionality. You'll want a gig of ram for this to work for a CD image, even more for a DVD image. Knoppix takes longer to boot with the "toram" parameter (it has to copy the entire CD up into ram), but you shouldn't be having to reboot all that often so this might not be a problem for you. Once it's booted via "toram" it's very fast. I've done this on a 2Gb ram system and it was quite perky.
I have not created a custom Knoppix CD personally, so I can't give you any specifics on this scenerio either. However, I know it can be done - so if this possibility is of interest to you, you can research.
There are two reasons I won't use Knoppix or other Live CDs. One is that my library system, where I'd like to deploy Linux is a public computing environment, does not use DHCP. The other is that we'd like to utilize some older, 400Mhz machines that will run Xandros and Ubuntu (for example), but not Knoppix or SUSE. So, I'd like to install the OS to the hard disk, but have an init script copy the unaltered contents of the /home/all directory from a backup upon reboot (before login). Someone I didn't think it would be this complicated, I'm just a Linux newb so I don't know how. How can I write an init script to erase the contents of /home/all and copy it over again from, say, /root/allbackup/?
Distribution: Debian Squeeze. Various live CD's Win7
Posts: 346
Rep:
Sorry for delay in getting back to you. I haven't tried this myself and am still learning.
You might want to try adding a script such as
tar -xvf home.tar to the boot sequence. This may be distro dependant but is likely to be
/etc/init.d/rc6.d. You need to know a bit about the booting process and I am still learning and testing.
Let's say I want to empty /home/all (and subdirectories) and refill it with the contents of /root/allbackup (and subdirectories) upon reboot. So, I find the /etc/init.d/rc6.d file (or whatever the proper init script is for my distro, Xandros OC3) and add these lines:
Distribution: Debian Squeeze. Various live CD's Win7
Posts: 346
Rep:
Back it up baby! Better yet test and burn backup. Blood pressure, anxiety and depression levels drop! Kdar rocks. USB disk?
Sounds ok if you want to delete /home.
Could do cd /home.
rm -rf all
Possibly a better alternative if you only want to replace the home directory is to run regular cron job of it - wouldn't take long unless you have an enormous home directory. Could do it hourly even. I haven't done it yet - still learning. Would need to run it from user accessible possibly hidden directory hidden somewhere as user. Cron as user??
But do backup at some stage on external media - you'll sleep better.
re: no DHCP. I'm not sure why (it wasn't my decision). But my guess is that it's because:
1. Some of our library branches only have 3-5 computers, so setting up a DHCP server for them seems like a waste. And, we probably don't have that many extra computers for 1 PC per branch, even old PCs.
2. If the DHCP server goes down, then everything would be off the internet, right? Can't have that.
I use DHCP so that I can add computers to my network with little effort and to have the system prevent private IP clashes. If the server NATing the main internet line goes down, nothing would have internet regardless of DHCP.
I suggested in a similar thread that tmpfs could be used instead of an rm -rf command.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.