Hi to all,
Is it possible to update/upgrade all the MD's from the core?. If I have several MD's if i want to keep them updated, all of them have to download from the internet the packages. Since they all boot up from the core, which means that they all should be at the same version of the core, would be faster to set up all the MD's to do the apt-get update/upgrade from the core?
My apologies if this is a dumb question, I just couldn't find an answer on the forum search
Cheers,
T
I do this with SSH.
If you are on your core, you can do...
sudo su -
ssh moonXX
...where XX is the device number of the MD (find this out in web admin).
Alternatively, if you are on another machine on the internal network, you can do...
sudo ssh root@192.168.80.1
ssh moonXX
...assuming you are using the standard internal IP of 192.168.80.1.
Note that it is necessary to SSH into the core as root because if you SSH in with your user ("purps" in my case), you won't have any admin privileges once you have SSHed into the MD.
More information about logging in etc here http://wiki.linuxmce.org/index.php/Logging_In
Cheers,
Matt.
EDIT: I just re-read your post. Don't think I answered your question did I. Why don't you want to download from Internet? Do you have monthly download limits or something?
1. Quicker
2. Less bandwith from user and from supplier side
3. Bongojoke
tompin2,
atm there is no defined way to update the MDs from a single (non Internet point). One way of achieving it, would be to copy the contents of the core's /var/cache/apt/archive directory into each MDs /usr/pluto/deb-cache dir, and rebuild the Packages file in the /usr/pluto/deb-cache directory, remove all the other sources from /etc/apt/sources.list except the file entry pointing to deb-cache.
Try if you can get it working, and maybe even write a small script, doing the steps for you one after the other.
Good luck.
Thanks to all, Im not good in linux but I will give it my best. Maybe I find something usefull for all. The way I see it is that I see an option under webadmin that you could just click to the MD page and update/upgrade, maybe it is not possible, maybe it is. For now, a good script should be a good progress. I hope I get the knoledge soon to make my own script and share it to all.
I will Keep all posted.
T
http://svn.linuxmce.org/trac.cgi/ticket/1099
Should work. Presumes MDs are on. Testing now. Can probably make a button in computing pretty easy. Will get back.
*I'm an idiot... that first one will exit after first moon unit is upgraded.
Quote from: l3mce on June 03, 2011, 05:34:17 PM
http://svn.linuxmce.org/trac.cgi/ticket/1099
Should work. Testing now. Can probably make a button in computing pretty easy. Will get back.
you should backup sources.list before overwriting
br Hari
Quote from: l3mce on June 03, 2011, 05:34:17 PM
http://svn.linuxmce.org/trac.cgi/ticket/1099
Can probably make a button in computing pretty easy.
Isn't there already a button under advanced called "upgrade" or something similar?
There is... but I believe this does not address MDs. I am thinking of just a global update button you can click if you want. I am also going to tar all of the md directories on the core, and try and use the systems db backup in case things go terribly wrong.
hari: done
Everyone else: completely redoing this and chrooting the MDs for upgrade. Ignore that first stumble into the idea. And the ticket has been closed. So much for a quick attack.
The ticket got closed, because we already have ticket 341 which does the same thing, and which already has most of the functionality in place (except the part of disabling the daemon autostart while in chroot). l3mce will take what we have, and add a few things to it.
http://svn.linuxmce.org/trac.cgi/attachment/ticket/341/globalUpgrades.10.sh
That is where I am. Here is the output after upgrading... (note core had already been upgraded, and output was huge due to database upgrade)
# /usr/pluto/bin/globalUpgrades.sh
Ign file: ./ Release.gpg
Ign file: ./ Translation-en_US
Ign file: ./ Release
Ign file: ./ Packages
Ign http://debian.slimdevices.com stable Release.gpg
Hit http://old-releases.ubuntu.com intrepid Release.gpg
Ign http://old-releases.ubuntu.com intrepid/main Translation-en_US
Ign http://old-releases.ubuntu.com intrepid/restricted Translation-en_US
Ign http://archive.ubuntu.com intrepid Release.gpg
Ign http://archive.ubuntu.com intrepid/main Translation-en_US
Ign http://debian.slimdevices.com stable/main Translation-en_US
Get:1 http://packages.medibuntu.org intrepid Release.gpg [197B]
Ign http://old-releases.ubuntu.com intrepid/universe Translation-en_US
Ign http://old-releases.ubuntu.com intrepid/multiverse Translation-en_US
Hit http://old-releases.ubuntu.com intrepid-security Release.gpg
Ign http://old-releases.ubuntu.com intrepid-security/main Translation-en_US
Ign http://old-releases.ubuntu.com intrepid-security/restricted Translation-en_US
Ign http://old-releases.ubuntu.com intrepid-security/multiverse Translation-en_US
Ign http://old-releases.ubuntu.com intrepid-security/universe Translation-en_US
Hit http://old-releases.ubuntu.com intrepid-updates Release.gpg
Ign http://deb.linuxmce.org intrepid Release.gpg
Ign http://deb.linuxmce.org intrepid/beta2 Translation-en_US
Ign http://deb.linuxmce.org 20dev_ubuntu Release.gpg
Get:2 http://debian.slimdevices.com stable Release [1645B]
Ign http://old-releases.ubuntu.com intrepid-updates/main Translation-en_US
Ign http://old-releases.ubuntu.com intrepid-updates/restricted Translation-en_US
Ign http://archive.ubuntu.com intrepid Release
Ign http://old-releases.ubuntu.com intrepid-updates/multiverse Translation-en_US
Ign http://deb.linuxmce.org 20dev_ubuntu/main Translation-en_US
Ign http://deb.linuxmce.org replacements_ubuntu Release.gpg
Ign http://deb.linuxmce.org replacements_ubuntu/main Translation-en_US
Ign http://deb.linuxmce.org intrepid Release
Ign http://old-releases.ubuntu.com intrepid-updates/universe Translation-en_US
Ign http://old-releases.ubuntu.com replacements_debian Release.gpg
Ign http://old-releases.ubuntu.com replacements_debian/main Translation-en_US
Hit http://old-releases.ubuntu.com intrepid Release
Hit http://old-releases.ubuntu.com intrepid-security Release
Ign http://debian.slimdevices.com stable/main Packages
Ign http://archive.ubuntu.com intrepid/main Packages
Ign http://packages.medibuntu.org intrepid/free Translation-en_US
Hit http://debian.slimdevices.com stable/main Packages
Ign http://deb.linuxmce.org 20dev_ubuntu Release
Ign http://deb.linuxmce.org replacements_ubuntu Release
Hit http://old-releases.ubuntu.com intrepid-updates Release
Err http://archive.ubuntu.com intrepid/main Packages
404 Not Found [IP: 91.189.88.140 80]
Ign http://old-releases.ubuntu.com replacements_debian Release
Ign http://deb.linuxmce.org intrepid/beta2 Packages
Hit http://old-releases.ubuntu.com intrepid/main Packages
Hit http://old-releases.ubuntu.com intrepid/restricted Packages
Hit http://old-releases.ubuntu.com intrepid/universe Packages
Hit http://old-releases.ubuntu.com intrepid/multiverse Packages
Hit http://old-releases.ubuntu.com intrepid/main Sources
Hit http://old-releases.ubuntu.com intrepid/restricted Sources
Ign http://packages.medibuntu.org intrepid/non-free Translation-en_US
Hit http://old-releases.ubuntu.com intrepid/multiverse Sources
Hit http://old-releases.ubuntu.com intrepid/universe Sources
Hit http://old-releases.ubuntu.com intrepid-security/main Packages
Hit http://old-releases.ubuntu.com intrepid-security/restricted Packages
Ign http://deb.linuxmce.org 20dev_ubuntu/main Packages
Hit http://old-releases.ubuntu.com intrepid-security/multiverse Packages
Hit http://old-releases.ubuntu.com intrepid-security/universe Packages
Hit http://old-releases.ubuntu.com intrepid-security/main Sources
Hit http://old-releases.ubuntu.com intrepid-security/restricted Sources
Hit http://old-releases.ubuntu.com intrepid-security/multiverse Sources
Hit http://old-releases.ubuntu.com intrepid-security/universe Sources
Hit http://old-releases.ubuntu.com intrepid-updates/main Packages
Ign http://deb.linuxmce.org replacements_ubuntu/main Packages
Hit http://old-releases.ubuntu.com intrepid-updates/restricted Packages
Hit http://old-releases.ubuntu.com intrepid-updates/multiverse Packages
Hit http://old-releases.ubuntu.com intrepid-updates/universe Packages
Hit http://old-releases.ubuntu.com intrepid-updates/main Sources
Hit http://old-releases.ubuntu.com intrepid-updates/restricted Sources
Hit http://old-releases.ubuntu.com intrepid-updates/multiverse Sources
Hit http://packages.medibuntu.org intrepid Release
Hit http://old-releases.ubuntu.com intrepid-updates/universe Sources
Ign http://old-releases.ubuntu.com replacements_debian/main Packages
Hit http://deb.linuxmce.org intrepid/beta2 Packages
Err http://old-releases.ubuntu.com replacements_debian/main Packages
404 Not Found
Hit http://deb.linuxmce.org 20dev_ubuntu/main Packages
Hit http://packages.medibuntu.org intrepid/free Packages
Hit http://deb.linuxmce.org replacements_ubuntu/main Packages
Hit http://packages.medibuntu.org intrepid/non-free Packages
Fetched 198B in 2s (85B/s)
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/intrepid/main/binary-i386/Packages.gz 404 Not Found [IP: 91.189.88.140 80]
W: Failed to fetch http://old-releases.ubuntu.com/ubuntu/dists/replacements_debian/main/binary-i386/Packages.gz 404 Not Found
E: Some index files failed to download, they have been ignored, or old ones used instead.
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Core upgraded, tarring Media Directors
touch: cannot touch `/tmp/tmp.viWgH27643/etc/chroot-install': No such file or directory
mv: cannot stat `/tmp/tmp.viWgH27643/usr/sbin/invoke-rc.d': No such file or directory
mv: cannot stat `/tmp/tmp.viWgH27643/sbin/start-stop-daemon': No such file or directory
/usr/pluto/bin/globalUpgrade.sh: line 21: /tmp/tmp.viWgH27643/usr/sbin/invoke-rc.d: No such file or directory
/usr/pluto/bin/globalUpgrade.sh: line 22: /tmp/tmp.viWgH27643/sbin/start-stop-daemon: No such file or directory
chmod: cannot access `/tmp/tmp.viWgH27643/usr/sbin/invoke-rc.d': No such file or directory
chmod: cannot access `/tmp/tmp.viWgH27643/sbin/start-stop-daemon': No such file or directory
! Package pluto-system-database (filename /var/cache/apt/archives/pluto-system-database_2.0.0.44.11041123890_i386.deb) is repeat;
ignored that one and using data from /var/cache/apt/archives/pluto-system-database_2.0.0.44.11052524012_i386.deb !
! Package pluto-boot-scripts (filename /var/cache/apt/archives/pluto-boot-scripts_2.0.0.44.11032623855_i386.deb) is repeat;
ignored that one and using data from /var/cache/apt/archives/pluto-boot-scripts_2.0.0.44.11052524012_i386.deb !
! Package pluto-website-admin (filename /var/cache/apt/archives/pluto-website-admin_2.0.0.44.11041423901_i386.deb) is repeat;
ignored that one and using data from /var/cache/apt/archives/pluto-website-admin_2.0.0.44.11052524012_i386.deb !
** Packages in archive but missing from override file: **
lmce-game-player lmce-game-plugin lmce-mediatomb lmce-sdlmame lmce-
sdlmess pluto-avwizard pluto-boot-scripts pluto-media-database
pluto-mythtv-plugin pluto-orbiter pluto-orbitergen pluto-pnp-
detection pluto-proxy-orbiter pluto-simplephone pluto-std-plugins
pluto-system-database pluto-updateentarea pluto-updatemedia pluto-
website-admin pluto-xine-plugin pluto-zwave-lighting
Wrote 21 entries to output Packages file.
cp: omitting directory `/var/cache/apt/archives/partial'
Ign file: ./ Release.gpg
Ign file: ./ Release
Ign file: ./ Packages
Reading package lists... Done
ping: unknown host moon
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
mythtv-backend mythtv-common mythtv-database mythtv-frontend
The following packages will be upgraded:
pluto-avwizard pluto-boot-scripts pluto-orbiter pluto-pnp-detection pluto-simplephone
5 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Need to get 0B/25.2MB of archives.
After this operation, 3178kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
pluto-avwizard pluto-pnp-detection pluto-boot-scripts pluto-simplephone pluto-orbiter
Authentication warning overridden.
Can not write log, openpty() failed (/dev/pts not mounted?)
(Reading database ... 113779 files and directories currently installed.)
Preparing to replace pluto-avwizard 2.0.0.44.11012423661 (using .../pluto-avwizard_2.0.0.44.11041123890_i386.deb) ...
Unpacking replacement pluto-avwizard ...
Preparing to replace pluto-pnp-detection 2.0.0.44.11030723802 (using .../pluto-pnp-detection_2.0.0.44.11052524012_i386.deb) ...
Unpacking replacement pluto-pnp-detection ...
Preparing to replace pluto-boot-scripts 2.0.0.44.11030723802 (using .../pluto-boot-scripts_2.0.0.44.11052524012_i386.deb) ...
Leaving `diversion of /usr/sbin/NetworkManager to /usr/sbin/NetworkManager.wraped by pluto-boot-scripts'
Unpacking replacement pluto-boot-scripts ...
Preparing to replace pluto-simplephone 2.0.0.44.11012423661 (using .../pluto-simplephone_2.0.0.44.11041123890_i386.deb) ...
Unpacking replacement pluto-simplephone ...
Preparing to replace pluto-orbiter 2.0.0.44.11030723802 (using .../pluto-orbiter_2.0.0.44.11052524012_i386.deb) ...
Unpacking replacement pluto-orbiter ...
Can not write log, openpty() failed (/dev/pts not mounted?)
Setting up pluto-avwizard (2.0.0.44.11041123890) ...
Setting up pluto-pnp-detection (2.0.0.44.11052524012) ...
Setting up pluto-boot-scripts (2.0.0.44.11052524012) ...
Installing new version of config file /etc/init.d/linuxmce ...
Setting up pluto-simplephone (2.0.0.44.11041123890) ...
Setting up pluto-orbiter (2.0.0.44.11052524012) ...
Upgrading from version '2.0.0.44.11030723802'. Not setting up X again
Moon57 upgraded
cp: omitting directory `/var/cache/apt/archives/partial'
Ign file: ./ Release.gpg
Ign file: ./ Release
Ign file: ./ Packages
Reading package lists... Done
ping: unknown host moon
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
mythtv-backend mythtv-common mythtv-database mythtv-frontend
The following packages will be upgraded:
lmce-game-player lmce-sdlmame lmce-sdlmess pluto-avwizard pluto-boot-scripts pluto-orbiter pluto-pnp-detection
pluto-simplephone
8 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Need to get 0B/48.9MB of archives.
After this operation, 20.4MB disk space will be freed.
WARNING: The following packages cannot be authenticated!
lmce-sdlmame lmce-sdlmess lmce-game-player pluto-avwizard pluto-pnp-detection pluto-boot-scripts
pluto-simplephone pluto-orbiter
Authentication warning overridden.
Can not write log, openpty() failed (/dev/pts not mounted?)
(Reading database ... 113455 files and directories currently installed.)
Preparing to replace lmce-sdlmame 2.0.0.44.11012423661 (using .../lmce-sdlmame_2.0.0.44.11052524012_i386.deb) ...
Unpacking replacement lmce-sdlmame ...
Preparing to replace lmce-sdlmess 2.0.0.44.11012423661 (using .../lmce-sdlmess_2.0.0.44.11052524012_i386.deb) ...
Unpacking replacement lmce-sdlmess ...
Preparing to replace lmce-game-player 2.0.0.44.11012423661 (using .../lmce-game-player_2.0.0.44.11052524012_i386.deb) ...
Unpacking replacement lmce-game-player ...
Preparing to replace pluto-avwizard 2.0.0.44.11012423661 (using .../pluto-avwizard_2.0.0.44.11041123890_i386.deb) ...
Unpacking replacement pluto-avwizard ...
Preparing to replace pluto-pnp-detection 2.0.0.44.11030723802 (using .../pluto-pnp-detection_2.0.0.44.11052524012_i386.deb) ...
Unpacking replacement pluto-pnp-detection ...
Preparing to replace pluto-boot-scripts 2.0.0.44.11030723802 (using .../pluto-boot-scripts_2.0.0.44.11052524012_i386.deb) ...
Leaving `diversion of /usr/sbin/NetworkManager to /usr/sbin/NetworkManager.wraped by pluto-boot-scripts'
Unpacking replacement pluto-boot-scripts ...
Preparing to replace pluto-simplephone 2.0.0.44.11012423661 (using .../pluto-simplephone_2.0.0.44.11041123890_i386.deb) ...
Unpacking replacement pluto-simplephone ...
Preparing to replace pluto-orbiter 2.0.0.44.11030723802 (using .../pluto-orbiter_2.0.0.44.11052524012_i386.deb) ...
Unpacking replacement pluto-orbiter ...
Can not write log, openpty() failed (/dev/pts not mounted?)
Setting up lmce-sdlmame (2.0.0.44.11052524012) ...
Setting up lmce-sdlmess (2.0.0.44.11052524012) ...
Setting up lmce-game-player (2.0.0.44.11052524012) ...
Setting up pluto-avwizard (2.0.0.44.11041123890) ...
Setting up pluto-pnp-detection (2.0.0.44.11052524012) ...
Setting up pluto-boot-scripts (2.0.0.44.11052524012) ...
Installing new version of config file /etc/init.d/linuxmce ...
Setting up pluto-simplephone (2.0.0.44.11041123890) ...
Setting up pluto-orbiter (2.0.0.44.11052524012) ...
Upgrading from version '2.0.0.44.11030723802'. Not setting up X again
Moon69 upgraded
cp: omitting directory `/var/cache/apt/archives/partial'
Ign file: ./ Release.gpg
Ign file: ./ Release
Ign file: ./ Packages
Reading package lists... Done
ping: unknown host moon
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
mythtv-backend mythtv-common mythtv-database mythtv-frontend
The following packages will be upgraded:
pluto-avwizard pluto-boot-scripts pluto-orbiter pluto-pnp-detection pluto-simplephone
5 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Need to get 0B/25.2MB of archives.
After this operation, 3178kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
pluto-avwizard pluto-pnp-detection pluto-boot-scripts pluto-simplephone pluto-orbiter
Authentication warning overridden.
Can not write log, openpty() failed (/dev/pts not mounted?)
(Reading database ... 113450 files and directories currently installed.)
Preparing to replace pluto-avwizard 2.0.0.44.11012423661 (using .../pluto-avwizard_2.0.0.44.11041123890_i386.deb) ...
Unpacking replacement pluto-avwizard ...
Preparing to replace pluto-pnp-detection 2.0.0.44.11030723802 (using .../pluto-pnp-detection_2.0.0.44.11052524012_i386.deb) ...
Unpacking replacement pluto-pnp-detection ...
Preparing to replace pluto-boot-scripts 2.0.0.44.11030723802 (using .../pluto-boot-scripts_2.0.0.44.11052524012_i386.deb) ...
Leaving `diversion of /usr/sbin/NetworkManager to /usr/sbin/NetworkManager.wraped by pluto-boot-scripts'
Unpacking replacement pluto-boot-scripts ...
Preparing to replace pluto-simplephone 2.0.0.44.11012423661 (using .../pluto-simplephone_2.0.0.44.11041123890_i386.deb) ...
Unpacking replacement pluto-simplephone ...
Preparing to replace pluto-orbiter 2.0.0.44.11030723802 (using .../pluto-orbiter_2.0.0.44.11052524012_i386.deb) ...
Unpacking replacement pluto-orbiter ...
Can not write log, openpty() failed (/dev/pts not mounted?)
Setting up pluto-avwizard (2.0.0.44.11041123890) ...
Setting up pluto-pnp-detection (2.0.0.44.11052524012) ...
Setting up pluto-boot-scripts (2.0.0.44.11052524012) ...
Installing new version of config file /etc/init.d/linuxmce ...
Setting up pluto-simplephone (2.0.0.44.11041123890) ...
Setting up pluto-orbiter (2.0.0.44.11052524012) ...
Upgrading from version '2.0.0.44.11030723802'. Not setting up X again
Moon82 upgraded
I clearly have a couple things to fix, and a few things I already have.
***The latest script is untested. I believe it works as desired. Will test shortly... including force closing to test the trap.
Great work!
An observation:
MDs already mount the core's /usr/pluto/deb-cache when they boot, for chroot upgrades the directory can be bound locally (mount --bind /usr/pluto/deb-cache /usr/pluto/diskless/XX/usr/pluto/deb-cache) on the core, negating the need to copy the .debs to the /usr/pluto/diskless/* locations. Duplicating the contents of the core's /usr/pluto/deb-cache for each MD is redundant and adds up to a huge amount of HD space.
Upgrade the core, then copy the contents of /var/cache/apt/archives/*.deb to /usr/pluto/deb-cache, run dpkg-scanpackages and gzip the Packages file. Then all MDs can have access to the latest files.
J.
Quote from: phenigma on June 06, 2011, 03:40:49 AM
Great work!
An observation:
MDs already mount the core's /usr/pluto/deb-cache when they boot, for chroot upgrades the directory can be bound locally (mount --bind /usr/pluto/deb-cache /usr/pluto/diskless/XX/usr/pluto/deb-cache) on the core, negating the need to copy the .debs to the /usr/pluto/diskless/* locations. Duplicating the contents of the core's /usr/pluto/deb-cache for each MD is redundant and adds up to a huge amount of HD space.
Upgrade the core, then copy the contents of /var/cache/apt/archives/*.deb to /usr/pluto/deb-cache, run dpkg-scanpackages and gzip the Packages file. Then all MDs can have access to the latest files.
J.
Thanks for the feedback.
On my 810 install, the only files that exist in the cores /var/cache/apt/archives are ones which upgrade. This is possibly a result of something in the past I have done.
Yes... it took me a couple of rereads to understand, and a little poking around to confirm, but you are exactly right... and that cleans this whole process up. Thank you very much. MUCH better way to handle it. I didn't realize a lot of that... and now I don't have to edit that Packages file... yay.
http://svn.linuxmce.org/trac.cgi/attachment/ticket/341/globalUpgrades.13.sh
That is so much cleaner. Will test in a few. Thanks again Phenigma! I have never used --bind before... I am presuming that I can umount the second directory in the bind when I am done with the process for each MD to avoid... weirdness.
Good stuff! Yep, unmount using the dir listed 2nd in the mount command.
I noticed that you're altering the init/startup scripts on the core instead of the MDs. This needs to be done for an MD that is updated via chroot, but not ssh. I'm attaching the version I tinkered with a little, it takes these things into account and should restore the original sources.list files. I admit I'm only just learning about trap now as well. I've tested it but not much. Keep up the good work!
J.
I also made a few changes...
My understanding was that I needed to address the scripts from the core, but expect you are correct. Thank you very much.
I do not understand:
mv /usr/pluto/diskless/$moonDir/usr/sbin/invoke-rc.d{,.lmce-update}
or
mv /usr/pluto/diskless/$moonDir/usr/sbin/invoke-rc.d{.lmce-update,}
Though in the Diskless_CreateTBZ.sh which I was stealing some of this method from it worked similarly. I was just moving the damned files obviously.
Also, if the files exist (as we make fakes), will this methodology require a -f (force) move to avoid overwrite confirmation?
How does this look?
http://svn.linuxmce.org/trac.cgi/attachment/ticket/341/globalUpgrades.15.sh
Other than not being as pretty as yours...
The scripts will be run from the MDs environment so the scripts need to be overridden there. Yes, the -f option should probably be used.
As for the {,.lmce-update}: the {A,B} substitutes a value of A for the first argument and substitutes the value of B for the second argument. So sometext{A,B} expands to: sometextA sometextB.
J.
Quote from: phenigma on June 06, 2011, 05:57:23 AM
The scripts will be run from the MDs environment so the scripts need to be overridden there. Yes, the -f option should probably be used.
As for the {,.lmce-update}: the {A,B} substitutes a value of A for the first argument and substitutes the value of B for the second argument. So sometext{A,B} expands to: sometextA sometextB.
J.
I figured that part out... I guess I just don't understand where lmce-update is coming from... and how it is available to both directories... I thought that was why I was creating the TEMP environment, and why I was just moving them about to and from there.
I really appreciate your help.
I see now that it creates /dir/file.lmce-update and then transfers it back.
Here is the latest. Had to move a bunch of stuff around.
http://svn.linuxmce.org/trac.cgi/attachment/ticket/341/globalUpgrades.16.sh
Now I need to incorporate the system backup function (I don't know if it is more than a sql dump) and exclude some directories from the tarring process... and then make a button under computing, which ideally spawns a monitor window, sort of like the web admin does for certain functions.
Dear All I´m very happy to see people interested on this topic, I really wish I could understand Linux more to help, I just dropped the idea but you guys are amazing :o, for me you are all talking in another language but I'm starting to learn little by little.
Keep up the good work, I wish I could bring the beers for moral support but I guess it will be a little bit difficult.
chears!
T
Quote from: tompin2 on June 11, 2011, 07:15:28 AM
Dear All I´m very happy to see people interested on this topic, I really wish I could understand Linux more to help, I just dropped the idea but you guys are amazing :o, for me you are all talking in another language but I'm starting to learn little by little.
Keep up the good work, I wish I could bring the beers for moral support but I guess it will be a little bit difficult.
chears!
T
The best help would be to test it. Of course it is doing upgrade work, which can break things, and in an experimental way, which can break things... if you wanted to test, you might make a clonezilla backup to an external drive.
To test a script, just go download it (bottom of page of link, choose original format) on your core. Find it (typically in /root/Desktop if you use firefox in LMCE) and cd into the directory in a shell. Then do the following
chmod +x globalUpgrades.16.sh
./globalUpgrades.16.sh
save the output of that window... and report successes or failures...
There are even backups made of the MDs in case things go haywire... and as I mentioned, I need to add some DB backup, and it becomes a fairly benign process.
Quote from: l3mce on June 06, 2011, 06:57:49 AM
Now I need to incorporate the system backup function (I don't know if it is more than a sql dump) and exclude some directories from the tarring process... and then make a button under computing, which ideally spawns a monitor window, sort of like the web admin does for certain functions.
The backup/restore process is a little more tricky.
The database is updated as the core is upgraded... Subsequent MD updates may have minor updates/changes applied to the database. Restoring the database from a backup would mean that the database information will be out of sync with the installed packages on the core. So a database restore should only be performed if the CORE packages would be restored to their original state as well. This is probably best done, by the user, through a clonezilla image or other external backup system. Perhaps there is a way to store a list of the upgraded packages to restore them at the same time as a database restore... This seems like it'd be pretty flaky.
Restoring a 'live' MD (one that is running) that had been upgraded through SSH means that the MD in question cannot simply be 'restored' from the backup directly. The machine would have to be powered down for the /usr/pluto/diskless/XX directory to be removed and then un-tar'd. Tricky, especially if someone is using the MD in question at the time.
Restoring an MD that is not running (updated through chroot) is trivial. The directory can be removed and restored from the .tar archive. Unless the MD is booted partway through the update/restore process... This would present an issue.
I think there are some big issues that would need to be addressed before any kind of restore capability could be implemented.
Other notes:
Use a variable for the DATE in your script, otherwise it is possible for a user to start the script one day and have the initial tar-ing of the backup archive, or the upgrades, take long enough it rolls over to the next day. For instance, lets say I start the script at 11:55pm, it tars for 20 minutes, and upgrades for 20 minutes. Later in the script the backup archive and the backed-up sources.list files will not be found because the date has rolled over to the next day... Perhaps just don't use the date in the backup name, unless you see a need for it to be there.
mv /usr/pluto/diskless/$moonDir/usr/sbin/invoke-rc.d{,.lmce-update}
mv /usr/pluto/diskless/$moonDir/sbin/start-stop-daemon{,.lmce-update}
echo -en '#!/bin/bash\necho "WARNING: fake invoke-rc.d called"\n' > /usr/pluto/diskless/$moonDir/usr/sbin/invoke-rc.d
echo -en '#!/bin/bash\necho "WARNING: fake start-stop-daemon called"\n' > /usr/pluto/diskless/$moonDir/sbin/start-stop-daemon
chmod +x /usr/sbin/invoke-rc.d
chmod +x /sbin/start-stop-daemon
The first 4 lines, above, affect the desired scripts in the MDs directories. The 2 final 'chmod' lines unfortunately are affecting the files on the core, not the MDs where you just created the diversion scripts. Those two lines need to point to the /usr/pluto/diskless/XX/... structure so the appropriate files are affected.
rsh moon$moonDir apt-get update || /bin/true
rsh moon$moonDir apt-get -f -y upgrade
rsh moon$moonDir apt-get upgrade -f -y --force-yes
In this code the middle line should be 'apt-get upgrade -f -y install', rather than the two 'upgrade' commands.
cat /usr/pluto/diskless/$moonDir/etc/apt/sources.list-`date +%Y%m%d`.bak > /usr/pluto/diskless/$moonDir/etc/apt/sources.list
Are you using 'cat' here for a specific purpose? I would use 'mv' here rather than cat. Unless you see a need to maintain lots of chronological backup files. Again, perhaps drop the date portion and use another file extension (such as .lmce-update) or something else. This can be done with the 'mv' command and using {..}, like the backup of the scripts.
cp -ru /var/cache/apt/archives/* /usr/pluto/deb-cache
This line doesn't need the 'r' option. I would also alter this and 'mv' (move) the files rather than duplicating them and comsuming the extra HD space. The only files that need to be affected here are the '*.deb' files, you don't want to move any sub-directories from ../apt/archives/ to ../pluto/deb-cache/ -- just the .deb files.
dpkg-scanpackages /usr/pluto/deb-cache /dev/null | gzip -9c > /usr/pluto/deb-cache/Packages.gz
Although I havn't tested it, this line will not create the 'Packages' file, only the 'Packages.gz' file. I did this is a couple steps in the version I edited to ensure both files are created. I think the both files are required, but I am not certain.
The cleanup trap should probably umount the bound deb-cache folder for the chroot updated MDs.
Wow, lots to look at! Keep it up!
J.
I am running out the door, but just wanted to comment on the Packages thing...
It does indeed create a Packages file, then zips it up.
# dpkg-scanpackages /usr/pluto/deb-cache /dev/null | gzip -9c > /usr/pluto/deb-cache/Packages.gz
** Packages in archive but missing from override file: **
acpi-support acpid adept akregator alsa-base alsa-modules-2.6.27-15-
generic alsa-source alsa-utils amarok amarok-common amarok-engine-
xine ansi2html ansi2html-source apache2 apache2-mpm-prefork apache2-
utils apache2.2-common apparmor apparmor-utils apport apport-qt apt
apt-utils apturl ark asterisk-perl asterisk-pluto attr autofs avahi-
autoipd avahi-daemon avahi-utils base-files bin86 bind9 bind9-host
bind9utils build-essential busybox-initramfs ca-certificates chan-
sccp cmake comerr-dev command-not-found command-not-found-data
compiz-wrapper console-setup consolekit cpp-4.3 cron cups cups-bsd
cups-client cups-common curl dash dbus dbus-x11 debhelper debian-
installer debootstrap dhcp3-client dhcp3-common dhcp3-server djmount
dkms dnsutils docbook-xml dolphin dpkg dpkg-dev dragonplayer elinks
elinks-data ethtool fakeroot ffmpeg fglrx-amdcccle fglrx-kernel-
source fglrx-modaliases file firefox firefox-3.0 firefox-3.0-
branding flac foo2zjs foomatic-filters freepbx fuse-utils g++ g++-
4.3 gamin gawk gcc-4.3 gcc-4.3-base gconf2 gconf2-common gettext
ghostscript ghostscript-x gksu gnome-app-install gnome-icon-theme
gnome-keyring gnome-mime-data gnome-mount gsfonts-x11 gwenview gzip
hai hai-src hal-info html2text id-my-disc imagemagick initramfs-
tools intltool-debian java-common jockey-common jockey-kde
kaddressbook kamera kate kde-icons-oxygen kde-printer-applet kde-
window-manager kde-zeroconf kdebase-bin kdebase-data kdebase-plasma
kdebase-runtime kdebase-runtime-bin-kde4 kdebase-runtime-data
kdebase-runtime-data-common kdebase-workspace-bin kdebase-workspace-
data kdebase-workspace-libs4+5 kdebluetooth kdegraphics-strigi-
plugins kdelibs-bin kdelibs-data kdelibs4c2a kdelibs5 kdelibs5-data
kdemultimedia-kio-plugins kdepasswd kdepim-kresources kdepim-strigi-
plugins kdepim-wizards kdepimlibs-data kdepimlibs5 kdeplasma-addons
kdeplasma-addons-data kdeplasma-addons-libs4 kdm kernel-package
kfind khelpcenter4 klipper kmag kmail kmix kmousetool knotes
konqueror konqueror-nsplugins konsole kontact konversation kopete
korganizer krdc krfb ksnapshot ksysguard ksysguardd ksystemlog
ktimetracker ktorrent kuser kwalletmanager language-pack-de
language-pack-de-base language-pack-en language-pack-en-base
language-pack-es language-pack-es-base language-pack-fr language-
pack-fr-base language-pack-it language-pack-it-base language-pack-ja
language-pack-ja-base language-pack-kde-de language-pack-kde-de-base
language-pack-kde-en language-pack-kde-en-base language-pack-kde-es
language-pack-kde-es-base language-pack-kde-fr language-pack-kde-fr-
base language-pack-kde-it language-pack-kde-it-base language-pack-
kde-ja language-pack-kde-ja-base language-pack-kde-pl language-pack-
kde-pl-base language-pack-kde-pt language-pack-kde-pt-base language-
pack-kde-ru language-pack-kde-ru-base language-pack-kde-zh language-
pack-kde-zh-base language-pack-pl language-pack-pl-base language-
pack-pt language-pack-pt-base language-pack-ru language-pack-ru-base
language-pack-zh language-pack-zh-base lib64asound2 lib64asound2-dev
libaa1-dev libadns1 libapache2-mod-php5 libapparmor-perl
libapparmor1 libappconfig-perl libapr1 libaprutil1 libarchive-zip-
perl libartsc0-dev libasound2 libasound2-dev libasound2-doc
libasound2-plugins libaudio-dev libaudiofile-dev libaudiofile0
libavahi-client3 libavahi-common-data libavahi-common3 libavahi-
compat-libdnssd1 libavahi-core5 libavahi-glib1 libavahi-qt3-1
libavc1394-0 libavcodec51 libavdevice52 libavformat52 libavutil49
libbind9-40 libbonobo2-0 libbonobo2-common libbonoboui2-0
libbonoboui2-common libc6 libc6-dev libc6-i686 libcaca-dev libcairo-
perl libcairo2 libcairomm-1.0-1 libcdio7 libck-connector0
libcompress-raw-zlib-perl libconvert-binhex-perl libcucul-dev
libcups2 libcups2-dev libcupsimage2 libcupsys2-dev libcurl3
libcurl3-gnutls libdate-manip-perl libdbd-mysql-perl libdbd-sqlite3-
perl libdbi-perl libdbus-1-3 libdc1394-22 libdigest-hmac-perl
libdigest-sha1-perl libdirectfb-dev libdirectfb-extra libdns43
libdns44 libdv4 libesd0-dev libevent1 libexpat1 libexpat1-dev
libfontconfig1-dev libfreetype6 libfreetype6-dev libft-perl libfuse2
libgamin0 libgcc1 libgconf2-4 libgcrypt11-dev libgd2-noxpm libgd2-
xpm libgksu2-0 libgl1-mesa-dev libglade2-0 libglib-perl libglib2.0-0
libglib2.0-data libglib2.0-dev libglibmm-2.4-1c2a libglu1-mesa-dev
libglu1-xorg-dev libgnome-keyring0 libgnome2-0 libgnome2-canvas-perl
libgnome2-common libgnome2-perl libgnome2-vfs-perl libgnomecanvas2-0
libgnomecanvas2-common libgnomecups1.0-1 libgnomeprint2.2-0
libgnomeprint2.2-data libgnomeprintui2.2-0 libgnomeprintui2.2-common
libgnomeui-0 libgnomeui-common libgnomevfs2-0 libgnomevfs2-common
libgnomevfs2-extra libgnutls-dev libgnutls26 libgomp1 libgp11-0
libgpg-error-dev libgphoto2-2 libgphoto2-port0 libgs8 libgsm1
libgssglue1 libgstreamer-plugins-base0.10-0 libgtk2-perl
libgtkhtml2-0 libgtkmm-2.4-1c2a libgtop2-7 libgtop2-common libhtml-
parser-perl libice-dev libicu38 libid3-3.8.3c2a libid3tag0 libidl0
libiec61883-0 libimlib2 libio-socket-inet6-perl libio-socket-ssl-
perl libio-stringy-perl libisc44 libisccc40 libisccfg40 libjasper1
libjpeg62-dev libkadm55 libkcddb4 libkdecorations4 libkdepim4
libkholidays4 libkipi-common libkipi5 libkleo4 libkonq5 libkonq5-
templates libkpgp4 libkrb5-dev libkrb53 libksieve4 libkwineffects1
liblaunchpad-integration1 liblcms1 liblcms1-dev libldap-2.4-2
liblircclient-dev liblircclient0 liblwres40 liblzo2-2 libmad0
libmagic1 libmagick10 libmail-sendmail-perl libmime-tools-perl
libmimelib4 libmng-dev libmodplug0c2 libmysqlclient15-dev
libmysqlclient15off libmyth-0.22-0 libmyth-0.23-0 libmyth-dev
libmyth-perl libmyth-python libmythtv-perl libncurses5-dev libneon27
libneon27-gnutls libnet-daemon-perl libnet-dns-perl libnet-ip-perl
libnet-ssleay-perl libnet-upnp-perl libnewt0.52 libnfsidmap2 libnm-
glib0 libnm-util0 libnotify1 libnspr4-0d libnss3-1d liboil0.3
libokularcore1 libopenexr6 libopenobex1 liborbit2 libossp-uuid15
libpam-ck-connector libpam-gnome-keyring libpam-modules libpam-
runtime libpam0g libpango1.0-0 libpango1.0-common libpangomm-1.4-1
libparted-1.8-8 libparted-1.8-dbg libparted-1.8-dev libparted-1.8-
i18n libparted1.8-9 libpcrecpp0 libperl5.10 libplasma2 libplrpc-perl
libpng12-0 libpng12-dev libpolkit-gnome0 libpoppler-qt4-3
libpoppler3 libpostproc51 libpq-dev libpq5 libpthread-stubs0
libpthread-stubs0-dev libpulse0 libqt3-compat-headers libqt3-headers
libqt3-mt-dev libqt4-assistant libqt4-core libqt4-dbus libqt4-
designer libqt4-dev libqt4-help libqt4-network libqt4-opengl libqt4-
opengl-dev libqt4-qt3support libqt4-script libqt4-sql libqt4-sql-
mysql libqt4-svg libqt4-test libqt4-webkit libqt4-xml libqt4-
xmlpatterns libqtcore4 libqtgui4 librpcsecgss3 librsvg2-common
libruby1.8 libsasl2-2 libsasl2-modules libschroedinger-1.0-0
libscrollkeeper0 libsdl-image1.2 libsdl-ttf2.0-0 libsdl1.2-dev
libsdl1.2debian-all libsexy2 libshout3 libslang2-dev libsm-dev
libsmbclient libsndfile1 libsnmp-base libsnmp15 libsocket6-perl
libsoup2.4-1 libspeexdsp1 libsql-abstract-limit-perl libsql-
abstract-perl libsqlite0 libsqlite0-dev libsqlite3-0 libssl-dev
libssl0.9.8 libstartup-notification0 libstdc++6 libstdc++6-4.3-dev
libsub-uplevel-perl libsvn1 libswscale0 libsys-hostname-long-perl
libsysfs-dev libt1-5 libtasn1-3-dev libtemplate-perl libtest-
exception-perl libtest-simple-perl libthai-data libthai0 libtie-
ixhash-perl libtiff4 libunicode-string-perl libvdpau-dev libvdpau1
libvolume-id0 libvorbis0a libvorbisenc2 libvorbisfile3 libvte-common
libvte9 libwbclient0 libwmf0.2-7 libwnck-common libwnck22 libx11-6
libx11-data libx11-dev libxau-dev libxcb-xlib0-dev libxcb1-dev
libxcursor-dev libxdmcp-dev libxext-dev libxfixes-dev libxft-dev
libxi-dev libxine-dev libxine1 libxine1-all-plugins libxine1-bin
libxine1-console libxine1-dbg libxine1-doc libxine1-ffmpeg libxine1-
gnome libxine1-misc-plugins libxine1-plugins libxine1-x libxine1-
xvdr libxineliboutput-fbfe libxineliboutput-sxfe libxinerama-dev
libxml-dom-perl libxml-libxml-common-perl libxml-libxml-perl libxml-
perl libxml-regexp-perl libxml-twig-perl libxml-writer-perl libxml-
xpath-perl libxml2 libxmu-dev libxmu-headers libxrandr-dev
libxrender-dev libxres1 libxt-dev linux-generic linux-headers-
2.6.27-11 linux-headers-2.6.27-11-generic linux-headers-2.6.27-14
linux-headers-2.6.27-14-generic linux-headers-2.6.27-15 linux-
headers-2.6.27-15-generic linux-headers-2.6.27-17 linux-headers-
2.6.27-17-generic linux-headers-2.6.27-7 linux-headers-2.6.27-7-
generic linux-headers-generic linux-image-2.6.27-11-generic linux-
image-2.6.27-14-generic linux-image-2.6.27-15-generic linux-image-
2.6.27-17-generic linux-image-2.6.27-7-generic linux-image-diskless
linux-image-generic linux-libc-dev linux-restricted-modules-2.6.27-
11-generic linux-restricted-modules-2.6.27-14-generic linux-
restricted-modules-2.6.27-15-generic linux-restricted-modules-
2.6.27-17-generic linux-restricted-modules-common linux-restricted-
modules-generic linux-sound-base lirc lirc-modules-source lirc-pluto
lirc-x lmce-datalog-database lmce-datalog-db lmce-datalogger-plugin
lmce-dpms-monitor lmce-enocean-tcm120 lmce-game-database lmce-game-
db lmce-game-player lmce-game-plugin lmce-generic-pc-workstation
lmce-hai-omni-rs232 lmce-hulu-player lmce-hulu-plugin lmce-hybrid
lmce-insteon lmce-launch-manager lmce-linux-igd lmce-mame-metadata
lmce-mame-snaps lmce-mediatomb lmce-mythtv-scripts lmce-pandora-
plugin lmce-phoenix-solo-usb lmce-picture-plugin lmce-picture-viewer
lmce-screen-capture-camera lmce-sdlmame lmce-sdlmess lmce-shoutcast-
radio-plugin lmce-skins-slate lmce-skins-titanium lmce-skins-uita
lmce-squeezeslave lmce-src-activate-orbiter-plasmoid lmce-src-
datalogger-plugin lmce-src-dpms-monitor lmce-src-enocean-tcm120
lmce-src-game-player lmce-src-game-plugin lmce-src-generic-pc-
workstation lmce-src-hai-omni-series-rs232 lmce-src-hulu-player
lmce-src-hulu-plugin lmce-src-launch-manager lmce-src-libwindowutils
lmce-src-lmce-datalog lmce-src-lmce-game lmce-src-pandora-plugin
lmce-src-picture-plugin lmce-src-picture-viewer lmce-src-screen-
capture-camera lmce-src-sdlmame lmce-src-sdlmess lmce-src-vistaicm2
lmce-update-system lmce-update-system-source lmce-update-traversal
lmce-vistaicm2 lmce-wiimote-support lmce-windowutils lmcevdr login
lshwd lsscsi lynx mail-transport-agent mce-diskless-tools mce-
diskless-tools-src mce-installer mce-launcher mdadm media-player-
only mesa-common-dev mjproxy mjproxy-src mtools mtx-pluto mysql-
client mysql-client-5.0 mysql-common mysql-server mysql-server-5.0
mytharchive mytharchive-data mythbrowser mythgallery mythgame
mythmovies mythmusic mythnetvision mythnetvision-data mythnews
mythplugins mythtv mythtv-backend mythtv-backend-master mythtv-
common mythtv-database mythtv-doc mythtv-frontend mythtv-perl
mythtv-themes mythtv-transcode-utils mythvideo mythweather mythweb
mythzoneminder nbd-client nbd-server network-manager network-
manager-kde nfs-common nfs-kernel-server nis nmap notification-
daemon ntp ntpdate nvidia-173-modaliases nvidia-177-modaliases
nvidia-180-modaliases nvidia-195-kernel-source nvidia-195-libvdpau
nvidia-195-modaliases nvidia-96-modaliases nvidia-common nvidia-glx-
195 nvidia-settings obex-data-server odbcinst1debian1 okular okular-
extra-backends openbsd-inetd openoffice.org-base-core
openoffice.org-calc openoffice.org-common openoffice.org-core
openoffice.org-draw openoffice.org-emailmerge openoffice.org-impress
openoffice.org-kde openoffice.org-math openoffice.org-style-crystal
openoffice.org-style-human openoffice.org-writer openssh-server
openssl parted parted-doc passwd patch perl perl-base perl-modules
perlmagick phonon-backend-xine php-pear php5-cli php5-common php5-
curl php5-gd php5-mysql pkg-config pluto-add-software pluto-app-
server pluto-asterisk pluto-audi-database pluto-avwizard pluto-
avwizard-skin-basic pluto-avwizard-sounds pluto-avwizard-src pluto-
bluetooth-dongle pluto-boot-scripts pluto-capture-card-scripts
pluto-cddb-ident pluto-chromoflex pluto-cm11a pluto-cm15a pluto-
confirm-dependencies pluto-convert-mac pluto-createdevice pluto-
database-settings pluto-dcecommon pluto-dcegen pluto-dcerouter
pluto-devel-dependencies pluto-dhcpd-plugin pluto-disc-drive-
functions pluto-disk-drive pluto-disk-monitor pluto-dummy-console-
tools pluto-dynamic-dns pluto-eib pluto-ffmpeg pluto-
firewire2video4linux pluto-gc100 pluto-generic-serial-device pluto-
hal-device-finder pluto-hald pluto-hald-src pluto-hdhomerun pluto-
hvr-1600 pluto-install-scripts pluto-irbase pluto-irtrans-ethernet
pluto-irtrans-wrapper pluto-libbd pluto-libresolution pluto-
libserial pluto-lirc-wrapper pluto-local-database pluto-makerelease
pluto-marbella-database pluto-mcr-remote pluto-media-database pluto-
messagesend pluto-messagetrans pluto-motion-wrapper pluto-mplayer
pluto-mplayer-player pluto-msiml-disp-butt pluto-mythtv-includes
pluto-mythtv-player pluto-mythtv-plugin pluto-network-storage pluto-
newmdinteractor pluto-nvidia-video-drivers pluto-orbiter pluto-
orbitergen pluto-orbiterinstaller pluto-photo-screen-saver pluto-
plcbus pluto-pluto-main-db pluto-pluto-media-db pluto-pluto-
security-db pluto-pluto-telecom-db pluto-plutodhcp pluto-plutoutils
pluto-pnp-detection pluto-powerfile-c200 pluto-proxy-orbiter pluto-
qos pluto-ra pluto-raid-tools pluto-remoteassistance pluto-sample-
media pluto-sdl-helpers pluto-security-database pluto-serializeclass
pluto-shiftstate pluto-simplephone pluto-skins-basic pluto-slim-
server-streamer pluto-slimserver-plugin pluto-sound-card-scripts
pluto-sql2cpp pluto-sqlcvs pluto-src-app-server pluto-src-asterisk
pluto-src-bluetooth-dongle pluto-src-cddb-ident pluto-src-chromoflex
pluto-src-cm11a pluto-src-cm15a pluto-src-confirm-dependencies
pluto-src-convert-mac pluto-src-createdevice pluto-src-dce-wrap
pluto-src-dcegen pluto-src-dcerouter pluto-src-disk-drive pluto-src-
disk-drive-functions pluto-src-eib pluto-src-generic-serial-devic
pluto-src-hal-device-finder pluto-src-irtrans-ethernet pluto-src-
irtrans-wrapper pluto-src-libbd pluto-src-libdce pluto-src-libirbase
pluto-src-libplutoutils pluto-src-libresolution pluto-src-libserial
pluto-src-libserializeclass pluto-src-makerelease pluto-src-
messagesend pluto-src-messagetranslation pluto-src-motion-wrapper
pluto-src-mplayer-player pluto-src-mythtv-player pluto-src-mythtv-
plugin pluto-src-network-storage pluto-src-newmdinteractor pluto-
src-orbiter pluto-src-orbitergen pluto-src-photo-screen-saver pluto-
src-pluto-main pluto-src-pluto-media pluto-src-pluto-security pluto-
src-pluto-telecom pluto-src-plutodhcp pluto-src-powerfile-c200
pluto-src-proxy-orbiter pluto-src-remoteassistance pluto-src-sdl-
helpers pluto-src-shiftstate pluto-src-slim-server-streamer pluto-
src-slimserver-plugin pluto-src-splitter pluto-src-sql2cpp pluto-
src-sqlcvs pluto-src-std-plugins pluto-src-test-serial-port pluto-
src-text-to-speech pluto-src-tribunetv pluto-src-updatemedia pluto-
src-usb-uirt-0038 pluto-src-utilities pluto-src-vdr pluto-src-vdr-
plugin pluto-src-vipshared pluto-src-vloopback pluto-src-voicemail-
monitor pluto-src-x-scripts pluto-src-xine-player pluto-src-xine-
plugin pluto-src-xml-data-plugin pluto-std-plugins pluto-storage-
devices pluto-system-database pluto-telecom-database pluto-test-
serial-port pluto-text-to-speech pluto-tribunetv pluto-updateentarea
pluto-updatemedia pluto-usb-uirt-0038 pluto-vdr pluto-vdr-plugin
pluto-vipshared pluto-vloopback pluto-voicemail-monitor pluto-
website-admin pluto-windowsce-libraries pluto-x-scripts pluto-xine-
player pluto-xine-plugin pluto-xml-data-plugin pluto-zwave-lighting
pm-utils po-debconf policykit-gnome poppler-utils portmap ppp procps
pwgen python-apport python-cairo python-gconf python-glade2 python-
gnome2 python-gnomecanvas python-gst0.10 python-gtk2 python-gtkhtml2
python-kde4 python-launchpad-integration python-libxml2 python-
mythtv python-numeric python-problem-report python-pyorbit python-
sexy python-software-properties python-uno python-vte python2.5
python2.5-minimal qt3-dev-tools qt4-qtconfig ruby1.8 samba samba-
common scons scrollkeeper setserial sgml-data shoutcast-src-radio-
plugin smbclient smbfs software-properties-gtk software-properties-
kde splix squashfs-tools squeezeboxserver squeezeslave ssh
subversion sudo svdrpservice-dev synaptic syslinux systemsettings
tasksel tasksel-data tcl8.4 tee-pluto tk8.4 traceroute ttf-dejavu
ttf-dejavu-extra ttf-opensymbol tzdata ubufox udev ufw unixodbc
update-manager-core update-manager-kde upnp-server-configuration
v4l2-firmware v4l2-modules vdpau-driver-all vdr vdr-addon-noad vdr-
dbg vdr-dev vdr-plugin-control vdr-plugin-dvbsddevice vdr-plugin-
examples vdr-plugin-iptv vdr-plugin-remotetimers vdr-plugin-
streamdev-client vdr-plugin-streamdev-server vdr-plugin-svdrpservice
vdr-plugin-vompserver vdr-plugin-wirbelscan vdr-plugin-xineliboutput
video-wizard-videos vim vim-common vim-runtime vim-tiny vorbis-tools
wget whiptail whois x11proto-core-dev x11proto-fixes-dev x11proto-
input-dev x11proto-kb-dev x11proto-randr-dev x11proto-render-dev
x11proto-xext-dev x11proto-xinerama-dev xbitmaps xfonts-scalable
xineliboutput-fbfe xineliboutput-sxfe xkb-data xorg-driver-fglrx
xserver-common xserver-xorg-core xserver-xorg-input-evdev xserver-
xorg-input-vmmouse xserver-xorg-video-ati xserver-xorg-video-intel
xserver-xorg-video-radeon xterm xtrans-dev xulrunner-1.9 xutils-dev
zaptel-modules-2.6.27-14-generic zaptel-modules-2.6.27-15-generic
zaptel-modules-2.6.27-16-generic zaptel-modules-2.6.27-17-generic
zlib1g-dev
Wrote 1085 entries to output Packages file.
Quote from: phenigma on June 13, 2011, 05:45:54 PM
The backup/restore process is a little more tricky.
The database is updated as the core is upgraded... Subsequent MD updates may have minor updates/changes applied to the database. Restoring the database from a backup would mean that the database information will be out of sync with the installed packages on the core. So a database restore should only be performed if the CORE packages would be restored to their original state as well. This is probably best done, by the user, through a clonezilla image or other external backup system. Perhaps there is a way to store a list of the upgraded packages to restore them at the same time as a database restore... This seems like it'd be pretty flaky.
Restoring a 'live' MD (one that is running) that had been upgraded through SSH means that the MD in question cannot simply be 'restored' from the backup directly. The machine would have to be powered down for the /usr/pluto/diskless/XX directory to be removed and then un-tar'd. Tricky, especially if someone is using the MD in question at the time.
Restoring an MD that is not running (updated through chroot) is trivial. The directory can be removed and restored from the .tar archive. Unless the MD is booted partway through the update/restore process... This would present an issue.
Yes. I have to do something much more substantial to prevent this from occurring. I am intending now to use the General_Info_Plugin to show progress in pending tasks, and I need to lock certain tasks like reboots, and work out a scheme to prevent MD booting while this process happens.
Quote from: phenigma on June 13, 2011, 05:45:54 PMI think there are some big issues that would need to be addressed before any kind of restore capability could be implemented.
I think you are right. That is now backburner, and once I get everything else licked I will look at it again.
Quote from: phenigma on June 13, 2011, 05:45:54 PMOther notes:
Use a variable for the DATE in your script, otherwise it is possible for a user to start the script one day and have the initial tar-ing of the backup archive, or the upgrades, take long enough it rolls over to the next day. For instance, lets say I start the script at 11:55pm, it tars for 20 minutes, and upgrades for 20 minutes. Later in the script the backup archive and the backed-up sources.list files will not be found because the date has rolled over to the next day... Perhaps just don't use the date in the backup name, unless you see a need for it to be there.
The problem I was trying to overcome by using the date, was in which people did an upgrade, and it did not produce the desired results, and they ran it again, it would hose the good backup. The worst thing to happen from the backup not being found, over the midnight hour, would be that a second backup would occur. This also protects the original sources.list from being overwritten... of course that could happen a different way.
Quote from: phenigma on June 13, 2011, 05:45:54 PM
mv /usr/pluto/diskless/$moonDir/usr/sbin/invoke-rc.d{,.lmce-update}
mv /usr/pluto/diskless/$moonDir/sbin/start-stop-daemon{,.lmce-update}
echo -en '#!/bin/bash\necho "WARNING: fake invoke-rc.d called"\n' > /usr/pluto/diskless/$moonDir/usr/sbin/invoke-rc.d
echo -en '#!/bin/bash\necho "WARNING: fake start-stop-daemon called"\n' > /usr/pluto/diskless/$moonDir/sbin/start-stop-daemon
chmod +x /usr/sbin/invoke-rc.d
chmod +x /sbin/start-stop-daemon
The first 4 lines, above, affect the desired scripts in the MDs directories. The 2 final 'chmod' lines unfortunately are affecting the files on the core, not the MDs where you just created the diversion scripts. Those two lines need to point to the /usr/pluto/diskless/XX/... structure so the appropriate files are affected.
Yes... I thought I fixed that... and I am also moving those on the core because I believe something in them affects the MDs... but I was confused on this issue. I will figure out exactly what they do and what I need to do. Thank you very much.
Quote from: phenigma on June 13, 2011, 05:45:54 PM
rsh moon$moonDir apt-get update || /bin/true
rsh moon$moonDir apt-get -f -y upgrade
rsh moon$moonDir apt-get upgrade -f -y --force-yes
In this code the middle line should be 'apt-get upgrade -f -y install', rather than the two 'upgrade' commands.
Yes... yes it should.
Quote from: phenigma on June 13, 2011, 05:45:54 PM
cat /usr/pluto/diskless/$moonDir/etc/apt/sources.list-`date +%Y%m%d`.bak > /usr/pluto/diskless/$moonDir/etc/apt/sources.list
Are you using 'cat' here for a specific purpose? I would use 'mv' here rather than cat. Unless you see a need to maintain lots of chronological backup files. Again, perhaps drop the date portion and use another file extension (such as .lmce-update) or something else. This can be done with the 'mv' command and using {..}, like the backup of the scripts.
I tend to use cat to avoid confirmation issues. That just overwrites the file.
Quote from: phenigma on June 13, 2011, 05:45:54 PM
cp -ru /var/cache/apt/archives/* /usr/pluto/deb-cache
This line doesn't need the 'r' option. I would also alter this and 'mv' (move) the files rather than duplicating them and comsuming the extra HD space. The only files that need to be affected here are the '*.deb' files, you don't want to move any sub-directories from ../apt/archives/ to ../pluto/deb-cache/ -- just the .deb files.
I had a weirdo nVidia folder so I did for good measure... I went back and forth on cp vs mv. I am not a big fan of duplication. I will change it.
Quote from: phenigma on June 13, 2011, 05:45:54 PMThe cleanup trap should probably umount the bound deb-cache folder for the chroot updated MDs.
Wow, lots to look at! Keep it up!
J.
You are right... it should. I thought:
umount /usr/pluto/diskless/$moonDir/usr/pluto/deb-cache
would do that.
It is so incredibly helpful to have fresh eyes reading giving feedback.
The latest script has a cheap global alert up to remind not to interfere with the process. I actually built a ridiculous graphic progress meter for it... but didn't bother including it because I need to do it the right way.
http://svn.linuxmce.org/trac.cgi/ticket/341