From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 1BEAB13827E for ; Fri, 13 Dec 2013 01:49:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 91AEFE09F3; Fri, 13 Dec 2013 01:49:03 +0000 (UTC) Received: from mail-qe0-f41.google.com (mail-qe0-f41.google.com [209.85.128.41]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 829E6E08A1 for ; Fri, 13 Dec 2013 01:49:02 +0000 (UTC) Received: by mail-qe0-f41.google.com with SMTP id gh4so1096290qeb.14 for ; Thu, 12 Dec 2013 17:49:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=IOZSIW+tMH9PVMEg6jIIy2EazHnzi4MdpvDWzksiTPg=; b=Geb0IkgciePZOS5IYcg7CDfNqKMo2HTfPWaHg3j16C4rixSl3AXLJijAowsPe/Z0hW wCD+sO2CdvLdVMF0VPgIZUW2stXsFaDjkIVbSHBrOPJNBSr0u+f5FvndCFcBttJE118n a1n1P8j9KMJ7R/Fw0Z6xVaEoXrR6erlqsmdJfI3GTQMUV/qdnjQHbssqqWOXTZgdCclJ 8H6QOBZS9iM8wkbv2R+BLUUWgOZV5rXN6jYsUvQjZL1E7VtvYfH+Y3MKjFQKwtO62Rzh PlE8MoShj+XV/zaCioIsZliunQQvNR6wBOlzpjMHGEJoCSa5ndKIMPd/7z63K2F9WpHc XnDg== Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 X-Received: by 10.49.35.112 with SMTP id g16mr19184185qej.13.1386899341526; Thu, 12 Dec 2013 17:49:01 -0800 (PST) Received: by 10.140.100.162 with HTTP; Thu, 12 Dec 2013 17:49:01 -0800 (PST) In-Reply-To: References: <524358B0.1060000@gmail.com> <52449C1A.5000306@gmail.com> <5245E03A.2020605@gmail.com> <52489438.3090405@gmail.com> <5249D186.8050808@gmail.com> <524A699E.6080006@gmail.com> Date: Thu, 12 Dec 2013 17:49:01 -0800 Message-ID: Subject: Re: [gentoo-user] Managing multiple systems with identical hardware From: Grant To: Gentoo mailing list Content-Type: text/plain; charset=ISO-8859-1 X-Archives-Salt: 2d0eede7-de4e-4a99-a5f8-145a4ac87e75 X-Archives-Hash: 2320945bb5e93e593cd5cd2f2992f379 >> I'm about to embark on this (perilous?) journey and I'm wondering if >> anyone would make a comment on any of the questions in the last >> paragraph below. This is basically my plan for setting up a bunch of >> systems (laptops) in an office which are hardware-identical to my own >> laptop and creating a framework to manage them all with a bare minimum >> of time and effort. >> >> Thanks, >> Grant >> >> >>>>>>>> I see what you desire now - essentially you want to clone your laptop >>>>>>>> (or big chunks of it) over to your other workstations. >>> >>> I've been working on this and I think I have a good and simple plan. >>> >>> My laptop roams around with me and is the "master" system. The office >>> router is the "submaster" system. All of the other office systems are >>> "minion" systems. All of the systems are 100% hardware-identical >>> laptops. All of the minions are 100% software-identical. >>> >>> I install every package that any system needs on the master and create >>> an SSH keypair. The only config files that change from their state on >>> the master are: /etc/conf.d/hostname, /etc/conf.d/net, >>> /etc/ssh/sshd_config, /etc/shorewall/*. I write comments in those >>> files which serve as flags for scripted changes. >>> >>> I write a script that is run from the master to the submaster, or from >>> the submaster to a minion. If it's the former, rsync / is run with >>> exceptions (/usr/portage, /usr/local/portage, /var/log, /tmp, /home, >>> /root but /root/.ssh/id_rsa_script* is included), my personal user is >>> removed, a series of workstation users are created with useradd -m, >>> services are added or removed from /etc/runlevels/default, and config >>> files are changed according to comment flags. If it's the latter, >>> rsync / is run without exceptions, services are added or removed from >>> /etc/runlevels/default, and config files are changed according to >>> comment flags. >>> >>> All user info on the submaster and minions would be effectively reset >>> whenever the script is run and that's fine. Root logins would have to >>> be allowed on the submaster and minions but only with the SSH key. >>> There are probably more paths to exclude when rsyncing master to >>> submaster. >>> >>> That's it. No matter how numerous the minions become, this should >>> allow me to keep everything running by administrating only my own >>> system, pushing that to the submaster, and having the submaster push >>> to the minions. I've been going over the nitty-gritty and everything >>> looks good. >>> >>> What do you think? Is there anything inherently wrong with rsyncing / >>> onto a running system? If there are little or no changes to make, >>> about how much data would actually be transferred? Is there a better >>> tool for this than rsync? I know Funtoo uses git for syncing with >>> their portage tree. >>> >>> - Grant >> > > Only thing that comes immediately to mind in rsyncing an overwrite of > / is that any process that's running that goes looking for libraries > or other data after the rsync pulls the rug out from beneath it might > behave erratically, crash, kick a puppy, write arbitrary data all over > your drive. Also, it's somewhat important to be careful about the > various not-really-there mounts, /dev, /sys, /proc... /run's probably > touchy too, and /var has a few pieces that might be in use mid-sync > and choke something along the way. My idea on that would be... build > an initramfs that: What if the push is done while no one is logged in to the system(s) being updated? I could also exclude /dev, /sys, /proc, and /run and reboot after the update. If that's not good enough, what if I boot the systems being updated into read-only mode before updating them? I'm hoping to keep the process as simple as possible. - Grant > 1) boots to a script > a) warns the user that it's hungry and that feeding it will be > dangerous to any non-backed-up data, with prompt > b) warns the user again, with prompt ('cause watching an rsync roll > by that eats that document you just spent 3 weeks on isn't fun) > 2) mounts / in a working directory > 3) rsyncs the new data from the sub-master > 4) kicks off a script to update a hardware keyed (mac address is good > for this) set of settings (hostname, etc) > 5) reboots into the new system. > > For extra credit... sync /home back to the sub-master to prevent > overfeeding the beast. > > -- > Poison [BLX] > Joshua M. Murphy