From owner-freebsd-questions Wed Dec 12 7:36:32 2001 Delivered-To: freebsd-questions@freebsd.org Received: from tharmas.rintrah.org (dhcp065-024-235-184.insight.rr.com [65.24.235.184]) by hub.freebsd.org (Postfix) with SMTP id 7F7C937B417 for ; Wed, 12 Dec 2001 07:36:26 -0800 (PST) Received: (qmail 10812 invoked by uid 1000); 12 Dec 2001 15:36:25 -0000 Date: Wed, 12 Dec 2001 10:36:25 -0500 From: devin-freebsdquestions@rintrah.org To: Filipe Brandenburger Cc: freebsd-questions@freebsd.org Subject: Re: Doing "batch" updates in single-user mode Message-ID: <20011212103624.A10754@tharmas.rintrah.org> Mail-Followup-To: Filipe Brandenburger , freebsd-questions@freebsd.org References: <5.1.0.14.1.20011212100146.00a6f420@imap.procergs.rs.gov.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <5.1.0.14.1.20011212100146.00a6f420@imap.procergs.rs.gov.br>; from filipe@procergs.rs.gov.br on Wed, Dec 12, 2001 at 10:11:36AM -0300 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Dec 12, 2001 at 10:11:36AM -0300, Filipe Brandenburger wrote: > > Hello, > > Sometimes I need to update some parts of the FreeBSD system in a way that > requires me to be in single-user mode. For example, if I want to replace > the libc, or if I want to keep my system current using CVSup and using > "make world", etc. > > I know I can go to the console of the host and type init 1 to go into > single-user mode, then I have a shell on the console, where I can issue the > commands I need to issue to update my system, and then when I exit the > shell with "^D" or "exit", the system goes back to multi-user mode, without > the need to reboot. > > I would like to know if there's somehow a way to do this without the need > to be on the console of the host. For example, I would like to know if > there's a way to write a script and tell FreeBSD to go into single-user > mode, execute the script, and get back to multi-user mode, without the need > to be on the console. > > I have two reasons for that. One is that I have to manage many (30+) hosts > with FreeBSD, and I would like to update all (or most) of them at the same > time. Other reason is that I would like to be able to schedule this kind of > update to 3:00AM or something like that, so that fewer people will be > affected by the downtime of the host, and I would like to do this update > without the need to be at the business to have to type the commands. Ok, I > know this would probably be too dangerous to do without watching, but hey, > if I test it before on a testing machine, I don't see much trouble in doing > this... > > Hope you can help me with this... Thanks in advance, > > Filipe I'm curious about this too, but I don't have a system to test it on right now. Wouldn't a shell script along the lines of: #!/bin/sh shutdown && cd && make ... eval exit or some such do the trick if run as root? --devin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message