mass producing linux

Place to discuss Fedora and/or Red Hat
Post Reply
byrdman
administrator
administrator
Posts: 225
Joined: Thu May 08, 2003 1:59 pm
Location: In the cloud

mass producing linux

Post by byrdman » Wed Jul 01, 2009 9:00 am

Couple of questions for the linux gurus:
1. What is a good way to create a linux pc exactly how you want it, create a ghost image of it, and mass produce CDs that can be used as auto-installers?
1a. These images might possibly need to format windoze PCs and install the image created?
2. I saw an open-source ghost alternative - FOG. Has anyone used it?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5712
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Wed Jul 01, 2009 11:16 am

I assume you want to be able to make this like a recovery CD that can be sent out into the field and the job be performed by anyone right? Should I also assume you don't have high bandwidth network connectivity back to a central location? Initially I thought custom kickstart installation CD but there are several ways you could do this.

If it were me I might just take the target system and strip it down to bare minimum, remove all unnecessary software. Then boot from alternate media, shrink the file system and partition down to a minimal size and then dd the partition off into an *.img file. I would create a custom Live CD that was stripped down and contained the disk image and would fire up a menu when booted which would allow the user to format the target system and restore the disk image. It wouldn't take much of a script tied to a menu option to format and partition the disk, restore the image (using dd), resize2fs the file system and install grub. The script could also mount the file system and customize a few things (host file, /etc/sysconfig/network, etc).

You could get rid of X altogether and make a simple text/curses based menu come up on initial boot which would make it a little faster and more targeted to the specific task. It would be much like any other recovery CD at that point.

byrdman
administrator
administrator
Posts: 225
Joined: Thu May 08, 2003 1:59 pm
Location: In the cloud

Post by byrdman » Thu Jul 02, 2009 8:08 am

yes, that is pretty much exactly what I want to do. Once I build a main image, I have to make it so I can give to a field tech and he can pop it in and watch it convert from ntfs to ext3!! it pretty much has to be fool-proof so that is the key to my continued success here as I pretty much have the whole team convinced that linux is the way to go...which has the IT director here in a fit because he lives & breathes M$. Let me paint the M$ picture here - they have one .net developer and they use visual source safe...? Huh?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5712
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Thu Jul 02, 2009 8:43 am

Good luck to you. I would probably work on that for you this weekend just for fun but I'm heading up to Chicago tomorrow with the wife and boy. Looking for something to do, might go to the Cubs game (there are a few tickets available on stubhub), then over to Grant Park for a Taste of Chicago and then fireworks. I have a reservation in South Bend so we'll head there after the fireworks and then up to Michigan on Saturday morning for the Red Bud national MX race (the second moto will be live on NBC Saturday afternoon). Sounds like a very fun project you are working on though!

byrdman
administrator
administrator
Posts: 225
Joined: Thu May 08, 2003 1:59 pm
Location: In the cloud

Post by byrdman » Thu Jul 02, 2009 9:36 am

Chi-town sounds fun. Your help might be requested as we get further down the project.
The prototype is up and running now and we are doing benchmarks on it now. I talked to a guy that had a mandrake system built for Heathrow in London (I think?) for two years without any reboots or problems. That was my motivation as we constantly have to tell clients to power off the system and power it back on. It is now getting to the point where if a system keeps failing, my boss is asking how hard would it be to replace it with the linux system.

byrdman
administrator
administrator
Posts: 225
Joined: Thu May 08, 2003 1:59 pm
Location: In the cloud

Post by byrdman » Tue Jul 07, 2009 7:43 am

more questions...
with my linux signage player, I have an account, demo, autologged on to the desktop, running firefox and displaying the show. This is logged on as demo :0
when I ssh into the box as demo, I am on demo pts/0.
Is there a way to send commands to the :0 session? For example, the 'firefox -remote openURL() command only works when you run it in the terminal on the logged in session, not the pts/0 session. There might be times that I need to restart firefox and I would like to do it via ssh rather then using VNC. Is there a way?
Another idea would be to watch /var/log/httpd/access_log which gives me a live log on the show playing...if this does not play, I would/could restart firefox if need be?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5712
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Tue Jul 07, 2009 9:11 am

It's an Xwindows deal and yes you can do that. First of all the host that you are logging in from has to have permission to connect to the Xserver by the demo account running on the kiosk machine:

Code: Select all

[demo@kiosk ~]$ xhost +remotemachinename
or to allow all hosts (less secure):

Code: Select all

[demo@kiosk ~]$ xhost +
This could be done in the demo user's login profile. Then when you ssh in as the demo user from remotemachinename you would set your display variable like so:

Code: Select all

[demo@kiosk ~]$ export DISPLAY=:0
Then you issue your firefox command you want:

Code: Select all

[demo@kiosk ~]$ firefox -remote "openURL(http://blahblahblah/)"
Of course you could also set up a script to watch that log and do this automatically like you mention. Also, instead of using xhost to grant X access to an entire machine (or to everyone) you can grant X access to a specific user using "xauth". Not sure what your remote security concerns are on these devices.

byrdman
administrator
administrator
Posts: 225
Joined: Thu May 08, 2003 1:59 pm
Location: In the cloud

Post by byrdman » Wed Jul 08, 2009 9:58 am

it is going to be pretty secure. The goal is to only allow port 22 or a custom port for SSH between the control server and the players. We would get into the control server in order to get into the players, but gaining complete control of the logged in desktop has been a challenge.

On a side note for creating the iso of the system, I found 'Revisor' which is a gui for creating the image...ever used it? I have it running on a system now and it seems locked up, waiting at 'Linking in Release Notes'

On a side note, to the side note, if I wrote a custom shell script, that basically does 'php playlist.php >> playlist.xml' but I want it to execute inside a php file, I saw that I can use exec() or system() in the php file and call this script...is there another way because it doesn't seem to generate the playlist.xml...

sorry for all the questions, but end of July is my deadline to get a pilot out in the field... :?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5712
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Wed Jul 08, 2009 10:26 am

If you want to gain complete control of the logged in desktop why don't you just VNC into it? You know VNC server is built in and all you have to do is check a checkbox to remote control a desktop right (System->Preferences->Remote Desktop)?

byrdman
administrator
administrator
Posts: 225
Joined: Thu May 08, 2003 1:59 pm
Location: In the cloud

Post by byrdman » Wed Jul 08, 2009 10:39 am

we have that for remote controling the desktop, but using CLI would be better(if possible). The xhost stuff you sent me helped alot (Thanks) but if we could do things through SSH, it would be better. VNC slows down the show when you are remoted in (small side effect and not a deal breaker) so one example would be to be able to kill firefox, and restart it with the settings that the demo user's firefox profile use.
so when I kill firefox, it kills it on the desktop, but when I restart it via CLI, it opens up a different firefox, that doesn't have the settings we set for demo's profile...
I want to try and not reboot the machine but I might have to do a log off/log on once in a while to keep from the memory usage to high. I started it last thursday and let it run over the holiday weekend and when I came in monday, it was really slow. Killing FF helped but the memory usage went from 217MB total on thursday to 380 on Monday, so something kept creeping up. restarting FF only brought it down to 330MB total but a reboot brought it back down to 217MB. The system has 1024MB of system ram...

User avatar
Void Main
Site Admin
Site Admin
Posts: 5712
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Wed Jul 08, 2009 10:56 am

Regarding your PHP question it works fine for me:

tst1.php

Code: Select all

<?
echo "This is a test\n";
?>
tst2.php

Code: Select all

<?
system("php tst1.php >> tst1.log");
?>
Execute:

Code: Select all

php tst2.php
tst1.log
This is a test

byrdman
administrator
administrator
Posts: 225
Joined: Thu May 08, 2003 1:59 pm
Location: In the cloud

Post by byrdman » Wed Jul 08, 2009 1:48 pm

I have a file called 'createxml' in /home/demo/bin with 755 permissions and demo:demo as the owner:group.
in my php file, located in /home/demo/www called updatedb.php.
inside updatedb.php at the end of the code, I have the 'system("php....) but it does not update the playlist.xml file which is located in /home/demo/project/ folder

createxml:
[code]#!/bin/sh
php /home/demo1/www/Playlist.php > /home/demo1/mojo/Playlist.xml[/code]

updatedb.php:
[code]<?php
require("db.php");

$action = $_POST['action'];
$updateRecordsArray = $_POST['recordsArray'];

if ($action == "updateRecordsListings"){

$listingCounter = 1;
foreach ($updateRecordsArray as $recordIDValue) {

$query = "UPDATE graphics SET recordListingID = " . $listingCounter . " WHERE recordID = " . $recordIDValue;
mysql_query($query) or die('Error, insert query failed');
$listingCounter = $listingCounter + 1;
}

echo '<pre>';
print_r($updateRecordsArray);
echo '</pre>';
echo 'If you refresh the page, you will see that records will stay just as you modified.';
}
system("php /home/demo1/www/Playlist.php > /home/demo1/project/Playlist.xml");
?>[/code]

User avatar
Void Main
Site Admin
Site Admin
Posts: 5712
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Wed Jul 08, 2009 4:49 pm

How is updatedb.php executed? If it is executed via the web server through the browser then it will be executed under user "apache". The file that you are trying to write to (playlist.xml) needs to also be writable by user apache in this case. I assume your "createxml" is executed by your demo user via cron or manually when logged on as that user but if it is updatedb.php is executed through apache then it will be user apache trying to write to the file. In addition to giving write permission to apache on that file you also have to make sure the apache user has at least execute permission on every directory below that file.

byrdman
administrator
administrator
Posts: 225
Joined: Thu May 08, 2003 1:59 pm
Location: In the cloud

Post by byrdman » Wed Jul 08, 2009 8:47 pm

You're a star!! Thanks...apache did not have write permissions to that file!

Wanna hear something scarry? This system was already sold and is going out to 90 locations in NY...
THe player and the control server are playing pretty nicely together, but I still need a CD image to wipe 90 winxp machines out of their misery!! :)
Plus about 30 other things to finalize...
you up for some possible consulting work? :D

User avatar
Void Main
Site Admin
Site Admin
Posts: 5712
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Thu Jul 09, 2009 6:31 am

Always. What's the timeframe? I'm heading up North after work today for a charity golf tournament tomorrow and will be spending the weekend with the relatives but other than that I should be available to help out.

Post Reply