How to set up a Puppy Linux Cybercafe

A home for all kinds of Puppy related projects
Message
Author
User avatar
Aitch
Posts: 6518
Joined: Wed 04 Apr 2007, 15:57
Location: Chatham, Kent, UK

#81 Post by Aitch »

Woohoo

Well done Rob, MZ & others

Online beers all round :wink:

Aitch :)

MagicZaurus
Posts: 107
Joined: Mon 05 Jan 2009, 17:35

#82 Post by MagicZaurus »

Great!

That's a really good news to go to sleep with a peaceful mind. It's already past midnight here.

TFTP is slower compared to booting from CD or USB. The reason is that the protocol is very simple and a bit slow. But it works and is still faster than booting Vista from the HD.

You can make it faster by removing unnecessary applications from the initrd.gz.

Good luck for your demo!

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#83 Post by ecomoney »

We need to ask John Murga to install this:-

[url=http://www.phpbbhacks.com/download/6314]PHPBB Virtual Beer Mod[url]

Ive had time to compose myself a little now. I really dont know how to thank you MagicZaurus. If I was a man of any means whatsoever I would be writing you a big fat cheque right now.

Hopefully one day I will be...Im planning on offering a custom smoothwall box as a slot in appliance from my companies website, but weve still go a long way to go with the puppy customization before then. Im sure in these bleak economic times it will be very popular cheap hassle-free plug in replacement for all those expensive and problematic Windows cybercafe's out there.

@Raffy - Yes it was the repackaged 4.2 RC3 that I made earlier that I booted, so that long list of commands is the definitive way of creating a netbootable puppy. It would be nice to have a script to automate this process i.e.

Code: Select all

makenetboot ./initrd.gz ./pup_420.sfs
This would mean me finding out about command line variables in bash scripting, and my poor brain needs a break for a bit. I may ask PizzasGood as he did a few good scripts to edit initrd.gz's and pup_xxx.2fs's a while back that I included in Ecopup. I can see Im going to have to do quite a lot of customizations of the pup_420.sfs and will need some kind of automated way of packaging them up before I send them over to to the 2 smoothwalls at the two cybercafe sites.

Anyway, It seems that on the next visit I make to the cybercafe, I will be able just stroll in with a ten year old server under my arm, plug in a few cables, make a few bios settings and delouse the entire place 8) :lol:

There is only one last job for me to do...break the news to Pascal hes made a smoothwall mod for something smoothwall does already out of the box :roll:

Many thanks to everyone for pushing the barriers and getting the project this far. I am forever in your debt.
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

MagicZaurus
Posts: 107
Joined: Mon 05 Jan 2009, 17:35

#84 Post by MagicZaurus »

Sorry ecomoney, I already posted in the Smoothwall forum just now. Hope that's not a problem.

I agree that there is still a lot of things to be done to get this a nice and smooth product. But your are on the right track.

Making a script to automate the creation of the initrd.gz shouldn't be a big problem.

Keep us updated how it goes with your demo at the cybercafes.

Ciao

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#85 Post by ecomoney »

Ive just read it, very diplomatically put MZ, Im sure I could not have done a better job...especially after the two days of banging my head against the wall. As you discovered the fix the duty should rightfully be all yours.
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

MagicZaurus
Posts: 107
Joined: Mon 05 Jan 2009, 17:35

#86 Post by MagicZaurus »

I saw that you are concerned about boot speed. My suggestion would be that you try it first with just the normal 100Mbps network card and router. I would presume that changing to 1Gbps doesn't help much. From what I read the TFTP protocol itself is a kind of bottleneck. A SSD might also not help much in terms of speed, but will help in terms of reliability and power consumption.

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#87 Post by ecomoney »

1 Minute and 8 seconds I think would be perfectly fine for them, my only concern would be that when they are booting the computers up in the morning would mean that they all would be pulling the initrd.gz file over the network at the same time. This takes about 28 seconds over a 100mb network @ 2mb per second, this is what I have timed it at with the stopwatch on my mobile phone.

I think at the Immingham site (which is open 9am-5pm) there are about thirty computers, I dont know if the rather primitive (so I have heard) tftp protocol would allow serving the initrd.gz file out to several clients simultaneously or not. If not 30 computers multiplied by 28 seconds. If it cant boot them simultaneously then that means that its going to take 840 seconds, or 14 minutes, to bring them all to life, which they could live with but wouldnt be great (Ive known many XP computers take longer than this to boot). If it cant boot them simultaneously then its going to mean 7 minutes of every day of someone going around pressing the power button every 30 seconds...I think.

I need to work out if it will boot them simultaneously or not, which would involve me raking out some sort of hub and filling the workshop with three or four zombie carcasses of old computers.

If the smoothwall had a gigabit connection between itself and the hub, AND the tftp server could send the initrd.gz file to all thirty computers at once, then the major bottleneck between the hub and the smoothwall would be eliminated. Ten computers could be booted every thirty seconds. It would take three seconds for the attendant in the morning to walk from one computer to another switching it on in any case.

I think I got those sums right, but my brain is still somewhat battered and bruised.

Anyhow, another matter Ive just noticed. Ive looked in the Hardinfo on the newly netbooted machine, and found out of the total of 385516kb of RAM that is on the machine, there is only only 135252kb of memory available. This means two thirds of the memory is taken up. I believe most of the computers at the cybercafe will be about 512mb of RAM so this is not too much of a problem, but it would be nice to have the extra 100/128ish mb extra to play with.

I have a theory that the netboot protocol on the client machines reserves an amount to copy the the initrd.gz file into. Raffy suggested that 102000kb be used for this, it is defined in the /home/pxelinux.cfg/default file

Code: Select all

DEFAULT Puppy
PROMPT 0
NOESCAPE 0
ALLOWOPTIONS 0
TIMEOUT 100

MENU TITLE Puppy Network Booting!

# Puppy Linux Loader
LABEL Puppy
MENU Puppy Net-Booting
KERNEL vmlinuz
APPEND initrd=initrd.gz ramdisk_size=[b]102013040[/b]

EOF
notice the repeated mistake with the bold tags. :roll:

When the client computer boots, the first thirty seconds are spent rolling dots ("."'s)across the screen while the initrd.gz is transfered across the network to it, then the "normal" done done done bootscreen appears as puppy boots. The usual lengthy one where it says

Code: Select all

Loading the pup_420.sfs file


only takes a split second. From what I know of the puppy boot process, normally the pup_420.sfs file (containing all of puppy's programs) would be loaded off the CD or Hard disk media into the computers memory on higher memory machines into RAM to give puppy its speed.

When netbooting, it seems that the pup_420.sfs file is still behaving the same way, ie being transfered from the "disk", ie the netboot ramdisk, into another ramdisk (hence it only takes a second), with the effect that essentially double the memory is being take up, the first chunk for the initrd.gz with the pup_420.sfs file inside, and the second being just pup_420.sfs. On a 384MB ram machine, this leaves just 128mb to play with, rather than 256MB (approximate figures).

I also understand, using boot parameters, it is possible to read the pup_420.sfs file directly from the disk, as would occur in an older machine without enough ram to preload the pup_420.sfs file, i.e. below 128mb of ram.

If netbooted puppy worked in this way, even on machines with a lot of ram, puppy programs would still be loaded into ram from the first chunk (the netboot ramdisk), rather than the second one as is occurring now. This would still mean that the netbooted puppy would open programs just as quickly because both copies are in RAM.

What are the boot parameters to force non-loading of the pup_420.sfs file into a new ramdisk? and where would I put them?
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

nic2109
Posts: 405
Joined: Mon 01 Jan 2007, 20:24
Location: Hayslope, near Middlemarch, Midlands, England

#88 Post by nic2109 »

@ecomoney; given your experience so far it has probably reinforced your determination to NOT include Open Office in the initial boot.

However; there is a products called Rootz that allows you to run it from where it is on the server (up in the Cloud perhaps!) by creating it as a kind of remote mount and running from there. See this forum thread from quite a while ago http://www.murga-linux.com/puppy/viewtopic.php?t=26218

It may be possible to add a menu entry to your build that launches a Rootz share on an Open Office installation on your server.

Good luck.
[color=darkblue][b][size=150]Nick[/size][/b][/color]

raffy
Posts: 4798
Joined: Wed 25 May 2005, 12:20
Location: Manila

RAMdisk

#89 Post by raffy »

ecomoney wrote:I have a theory that the netboot protocol on the client machines reserves an amount [of RAM] to copy the the initrd.gz file into. Raffy suggested that 102000kb be used for this...
The ramdisk_size parameter could be unique to Philip Jounin's TFTP (in Windows). MZ does not mention it for dnsmasq. Here is a Debian guide mentioning dnsmasq config options: http://www.debian-administration.org/articles/478

Another consideration would be Puppy's initrd. Barry must have coded ramdisk_size in it, and we might be required to supply the numbers.

Barry was clear as to the unit of ramdisk_size, which is KB, so the number you have above should be pruned by 3 digits. (Dividing your given amount by 1024 should give you the precise ramdisk_size.)
ecomoney wrote:What are the boot parameters to force non-loading of the pup_420.sfs file into [Puppy's tmpfs]? and where would I put them?
"pfix=noram" is the usual parameter, and it must be placed along the APPEND line.

EDIT: "pmedia=idehd" should force Puppy to search the hard disk for sfs, but am not sure if that would work with PXE booting. Plus, if you put that in /pxelinux.cfg/default, then all client PCs should have hard disks and pup_420.sfs in them. One advantage of this is that you can use OpenOffice as a local file.

Unfortunately, when you do these last considerations, the question changes to "Why use PXE at all?"
Puppy user since Oct 2004. Want FreeOffice? [url=http://puppylinux.info/topic/freeoffice-2012-sfs]Get the sfs (English only)[/url].

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#90 Post by ecomoney »

nic, thank you for bringing that to my attention, your right openoffice would be a pain to have to load into ram each time, the smallest version I can find is an extra 50mb (version 1.1), and the latest version (3.1) is about 384mb. This would nearly quadruple the amount of RAM required and the boot time of the computers....but what to do with .ppt and .docx files? Quite often these are sent as attachments via email. If an reliable openoffice install were created for 4.2 (something that is sorely needed) then mounting it over a network share would be an excellent way of getting at the extra functionality without having to increase boot times or memory requirements.

Im thinking...as well as openoffice, what about JAVA? Many websites require it to get their advanced functions to work...for example Facebook and Ebay. This may be another "nice to have" that could be called from the server when required. Maybe even Wine? They have a problem with people installing their own programs on the cybercafe computers now...but why not let them if that is what they want to do? One one minute reboot and its back to a clean install anyhow.

I will chalk that up as a "nice to have" for the time being, it would be better to have something stable and tested (like Im sure 4.2 is going to be), see how much of a demand there is, and create this function if necessary. Good to know about this package though, thanks again for pointing it out.

Ive had a quick look at pebble, and I think...in theory, this could be got to work also with netbooting. One step at a time tho.
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#91 Post by ecomoney »

thanks for the tip Raffy, and the knowledge of what to call things. I posted just after you.

I changed the APPEND line in the /home/tftpboot/pxelinux.cfg/default file to read

Code: Select all

APPEND initrd=initrd.gz pfix=noram
and took away the Ramdisk section entirely. This didint seem to me to make any difference whatsoever, the boot section still read "loading main pup_420.sfs" file (which it shouldnt do am I correct) and there were no RAM savings.

I had a look into the "init" file which is in the initrd.gz and found some interesting options. I think the new boot menu perhaps has some different boot parameters

Lines 167-184

Code: Select all

#now supporting a boot menu...
if [ "$pfix" ];then
 for ONEFIX in `echo -n "$pfix" | tr ',' ' '`
 do
  case $ONEFIX in
   ram)     PRAMONLY="yes";;      #run in ram only (do not load pup_save).
   rdsh)    RDSH="yes";;          #exit to shell in initial ramdisk.
   nox)     PNOX="yes";;          #do not start X.
   clean)   PCLEAN="yes";;        #force version upgrade and cleanup.
   purge)   PPURGE="yes";;        #radical cleanup for broken system.
   copy)    PCOPY="yes";;         #copy .sfs files into ram.
   noram)   PNORAM="yes";;        #v412 partial restore no copy sfs to ram.
   fsck)    PFSCK="yes";;         #do a fsck of pup_save file.
   [0-9]*)  PIGNORELAST=$ONEFIX;; #blacklist last $ONEFIX folders (multisession).
  esac
 done
fi
[ "$PNORAM" = "yes" ] && PCOPY="no" #v412
perhaps is something to do with these boot options

Ive had a quick scan of the "init" file (man that is some piece of engineering!) and in parts it refers to to humungous initrd's. I will attach it to this post, because Im having some real trouble deciphering it for now.

If it does turn out that it is "double-loading" the pup_420.sfs file (once while it loads the initrd.gz via PXE and then again during bootup proper (the tmpfs?) then this is a bug in puppy's implementation of netbooting. In netbooting, it should be able to call programmes directly from the pup_420.sfs inside the initrd.gz, otherwise client computers will waste RAM that could be used for running programs once puppy has PXE booted. It could also just be that the size of the free RAM in the final netbooted puppy is reported as larger, because I did hear that if Linux does find extra ram then it just uses it. If it is a bug(let) then it would be good to iron out and give and extra 100mb or so RAM for applications.

Im also going to have to add code to this file to autodhcp eth0 at bootup, to connect back to the smoothwall server for an i.p. address for the internet connection. That way the internet will "just work" when they launch seamonkey. Is this along the lines of

Code: Select all

dhcpcd eth0
?
Attachments
init.zip
init script from within the netboot initrd.gz for puppy linux 4.2 RC3
(17.1 KiB) Downloaded 469 times
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

raffy
Posts: 4798
Joined: Wed 25 May 2005, 12:20
Location: Manila

load <> copy

#92 Post by raffy »

I used "tmpfs" because I believe that's how Puppy's ramdisk is called (and there is another ramdisk associated with PXE booting). You're right, there should be no duplication of RAMdisks. You can check this while puppy is running via "df -h" in console : if there is loop0 and no identical tmpfs, then no separate RAMdisk is given to pup_420.sfs.
ecomoney wrote:.. the boot section still read "loading main pup_420.sfs" file (which it shouldnt do...
In theory, it should say "copying to RAM" if it is copying pup_420.sfs to RAM.
ecomoney wrote:It could also just be that the size of the free RAM in the final netbooted puppy is reported as larger, because I did hear that if Linux does find extra ram then it just uses it.
Puppy uses another tmpfs for /tmp (the scratch file), and that consumes RAM, too. The free RAM is displayed with "free" in console.
ecomoney wrote:Im also going to have to add code to this file to autodhcp eth0 at bootup
If you follow the old network wizard and save the setting, you will have eth0mode in /etc. Copy that into the remastered /etc and you will have autodhcp at boot time.
Puppy user since Oct 2004. Want FreeOffice? [url=http://puppylinux.info/topic/freeoffice-2012-sfs]Get the sfs (English only)[/url].

MagicZaurus
Posts: 107
Joined: Mon 05 Jan 2009, 17:35

#93 Post by MagicZaurus »

1) From what I read at the dnsmasq man pages the TFTP server can handle multiple connections. The default maximum is 50 connections, but it can be changed with the following parameter in dnsmasq.conf.

Code: Select all

tftp-max=<connections>
But they mention that it depends on the number of available file descriptors. For every client 1 file descriptor is used up. So it depends on how many concurrent file accesses the Smoothwall kernel can handle and how many file descriptors are taken up by other processes on the Smoothwall.

2) For the RAM issue. How did you get the number of free RAM? There are always doubts about the number from 'top' command. If I boot from CD and check with 'top' I also get 275MB used and I'm pretty sure that the sfs-file is only loaded once. In my opinion the sfs-file also is only once on memory for the netbooting, but because more RAM is available the sfs-file will be 'decompressed' so that later access is faster.

MagicZaurus
Posts: 107
Joined: Mon 05 Jan 2009, 17:35

#94 Post by MagicZaurus »

One more issue came to my mind. Running the TFTP on the Smoothwall is a small security risk. TFTP doesn't need any authentication. So make sure it is only serving requests on the internal LAN interface and not the interface to the Internet. Still a small issue if you have nasty guests in your cybercafe who want to try to use the TFTP port to hack into your Smoothwall.

The TFTP protocol is slow because every data packet (maximum 1500 bytes) need to be acknowledged by the client before the next packet is send. Other protocols can send a few packets in a burst and the packets are numbered and the client can just request back if he missed out a packet. That's in simple words what I understood of the whole story.

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#95 Post by ecomoney »

@Raffy Yes, with the ram issue, I suppose the only sure way of testing is to reduce the RAM in the client machine to say 128mb and see if it still netboots. That way there will be no chance that the client computer will be able to hold both the initrd.gz (100MB) and a separate pup_420.sfs (100MB) in memory at the same time. I wish I knew of another method for making sure this isnt happening.

@MZ Re "File Descriptors", are these released once the tftp request has finished (i.e. the client booted)? I think I may need to ask these questions on the Smoothwall forum, especially about the open tft port on the "internet" side of the smoothwall. The terminology they use for this the "RED" interface for the network port connected to the modem, and "GREEN" for the network port connected via the hub to the client p.c.'s. From what I have read (most of which I dont understand) these guys are *very* knowledgeable when it comes to network security and the internals of whats going on. I will raise your concerns there, unless you wish to do it MZ? You could probably explain it a let better to them.

Another smoothwall mod that may be required is a "Cybercafe Supervisors Control Panel". At the immingham site there is an attendant onsite at all times, responsible for taking money and setting access (its only £1 per hour to cover costs, although I unofficially anyone in trouble may use it for free). This would list the active clients, set times and allow the supervisor to log individuals on and off.
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#96 Post by ecomoney »

Grrrrr! Ive just remembered, hotmail doesnt let people send messages when theyre using a linux client!!!! Guess theyre worried about linux users telling others how good Linux is!

I may have to modify the "useragent" settings on seamonkey to hack past this.
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

Trobin
Posts: 968
Joined: Fri 19 Aug 2005, 03:16
Location: BC Canada

#97 Post by Trobin »

http://www.murga-linux.com/puppy/viewtopic.php?t=36436

I had to use both methiods to get hotmail working in Seamonkey.
[url]http://speakpup.blogspot.com[/url]

MagicZaurus
Posts: 107
Joined: Mon 05 Jan 2009, 17:35

#98 Post by MagicZaurus »

1) Don't worry about the file descriptors. Standard setting in the linux kernel is 1024 descriptors for a single process. That is more than enough to serve 50 clients at the same time. But I expect the performance is not so good if you really boot all 50 machines at once. You can try and see how it performs.

2) For controlling the access you indeed need another MOD. If it doesn't exist then this will be a bigger project, as I expect that you want nice GUI, user friendly, bullet proof, ....

3) For the TFTP port it seems it's quite safe on the red interface. I read that all incoming traffic on red is blocked unless it's a response to an outgoing traffic.

User avatar
Aitch
Posts: 6518
Joined: Wed 04 Apr 2007, 15:57
Location: Chatham, Kent, UK

#99 Post by Aitch »


User avatar
ecomoney
Posts: 2178
Joined: Fri 25 Nov 2005, 07:00
Location: Lincolnshire, England
Contact:

#100 Post by ecomoney »

Ive just had this email through from the author of DNSMASQ!!!!
Hello,


I'm the author of dnsmasq. I have a regular Google-groups search going to keep an eye on how my baby is doing out in the world, and it found the thread on Murga-linux.com where you are talking about netbooting stuff.


I don't want to create yet another account to post there, so I though I'd just mail you, feel free to repost any of this stuff.

File descriptors: the limit is the number of descriptors available to a process: this is normally 1024, with a dozen of so used for other things, so you have plenty of room to increase the default tftp-max limit. The descriptors are only used while the tftp transfer is happening, and released afterwards. Each transfer uses two, one to read the file and one for a UDP socket, but if many transfers of the same file are going on, that only takes one descriptor plus one for the socket for each transfer.

Booting 100 machines should not take 100 times longer than booting one: TFTP uses the network very inefficiently, so there should be enough bandwidth for many transfers simultaneously.

Security. You should be OK, the dnsmasq TFTP server doesn't accept writes, and only gives access to stuff under --tftp-root. Look at the man page entry for tftp-secure too, If you're running dnsmasq as a dedicated user, you can make it serve only files owned by that user.


HTH

Simon.
This blew me away that the author of such a popular piece of software should go out of his way to contact me in this way to offer his knowledge. How come free software has better "customer support" than anything commercial I have ever paid for?

My faith in humanity is restored :D
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]

Sorry, my server is down atm!

Post Reply