LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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

Reply
 
LinkBack Search this Thread
Old 01-27-2006, 08:41 AM   #1
lukeprog
Member
 
Registered: Oct 2005
Posts: 92

Rep: Reputation: 15
deepfreeze on Linux - another way


I've been trying to set up a DeepFreeze-esque solution for Linux. Apparently, it's possible, as proprietary solutions like Discoverstation have it figured out. You can use tmpfs for something like DeepFreeze on a user account, but it doesn't play nicely with the KDE Kiosk Admin tool.

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!
 
Old 01-30-2006, 04:23 PM   #2
mazinoz
Member
 
Registered: Mar 2003
Location: Mansfield Queensland Australia
Distribution: Debian Squeeze. Various live CD's Win7
Posts: 346

Rep: Reputation: 32
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.

Cheers
 
Old 01-30-2006, 06:14 PM   #3
lukeprog
Member
 
Registered: Oct 2005
Posts: 92

Original Poster
Rep: Reputation: 15
Hmmm, yes, I'm looking at kdar and dar. What file(s) can I edit for init scripts (pre-login)?
 
Old 01-30-2006, 07:14 PM   #4
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, Slackware, Slax, Knoppix, SysrescueCD
Posts: 1,328

Rep: Reputation: 51
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:

http://www.linuxjournal.com/article/7714

I believe unionfs is what Knoppix uses to allow "changes" to its non-writeable OS stored on CD-ROM.
 
Old 01-30-2006, 07:22 PM   #5
mazinoz
Member
 
Registered: Mar 2003
Location: Mansfield Queensland Australia
Distribution: Debian Squeeze. Various live CD's Win7
Posts: 346

Rep: Reputation: 32
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!
 
Old 01-31-2006, 11:25 AM   #6
lukeprog
Member
 
Registered: Oct 2005
Posts: 92

Original Poster
Rep: Reputation: 15
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)?
 
Old 01-31-2006, 01:20 PM   #7
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, Slackware, Slax, Knoppix, SysrescueCD
Posts: 1,328

Rep: Reputation: 51
Quote:
Originally Posted by lukeprog
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.
 
Old 01-31-2006, 06:43 PM   #8
lukeprog
Member
 
Registered: Oct 2005
Posts: 92

Original Poster
Rep: Reputation: 15
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/?
 
Old 02-03-2006, 04:17 PM   #9
mazinoz
Member
 
Registered: Mar 2003
Location: Mansfield Queensland Australia
Distribution: Debian Squeeze. Various live CD's Win7
Posts: 346

Rep: Reputation: 32
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.

I'm going to look at unionfs as well.
 
Old 02-04-2006, 09:23 AM   #10
lukeprog
Member
 
Registered: Oct 2005
Posts: 92

Original Poster
Rep: Reputation: 15
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:

rm -rf /home/all
mkdir -m 755 /home/all
cp -ar /root/allbackup /home/all

I'm betting I made a mistake above, as I rarely bash. I'm scared to try it! There's no global "undo" for Linux :-)
 
Old 02-07-2006, 04:29 PM   #11
mazinoz
Member
 
Registered: Mar 2003
Location: Mansfield Queensland Australia
Distribution: Debian Squeeze. Various live CD's Win7
Posts: 346

Rep: Reputation: 32
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.
 
Old 02-07-2006, 05:41 PM   #12
KimVette
Senior Member
 
Registered: Dec 2004
Location: Bawstun area
Distribution: Suse (10.2, 10.3), CentOS, and Ubuntu
Posts: 1,794

Rep: Reputation: 46
Quote:
Originally Posted by lukeprog
One is that my library system, where I'd like to deploy Linux is a public computing environment, does not use DHCP.
I presume this is for accountability?

Easy solution. Set up DHCP, but have it reserve IP addresses on a per-MAC-address basis.
 
Old 02-09-2006, 09:02 AM   #13
lukeprog
Member
 
Registered: Oct 2005
Posts: 92

Original Poster
Rep: Reputation: 15
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.
 
Old 02-09-2006, 11:41 AM   #14
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,997

Rep: Reputation: 107Reputation: 107
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.
 
Old 02-09-2006, 12:41 PM   #15
lukeprog
Member
 
Registered: Oct 2005
Posts: 92

Original Poster
Rep: Reputation: 15
Like I said, no DHCP wasn't my idea.

And I've tried tmpfs, but it seems to interfere with the KDE Kiosk tool. Otherwise, that would've been a really simple way to git 'er dun.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
deepfreeze dajomu Linux - Software 24 09-28-2008 03:00 PM
link dies intermittently-seemingly at random- between win<->linux not linux<->linux?? takahaya Linux - Networking 10 03-09-2007 10:37 PM
triple boot linux/linux/linux No Windows involved toastermaker Linux - Newbie 12 03-02-2006 10:40 PM
Redhat (rhel v2.1) bootup problem with linux (linux vs linux-up) namgor Linux - Software 2 06-24-2004 02:49 PM


All times are GMT -5. The time now is 12:44 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration