From owner-freebsd-questions Wed Dec 12 9:54:57 2001 Delivered-To: freebsd-questions@freebsd.org Received: from paloalto.procergs.com.br (paloalto.procergs.com.br [200.198.128.119]) by hub.freebsd.org (Postfix) with ESMTP id 5A87C37B416 for ; Wed, 12 Dec 2001 09:54:49 -0800 (PST) Received: from quebec.procergs.com.br (quebec.procergs.com.br [200.198.128.236]) by paloalto.procergs.com.br (Postfix) with ESMTP id DA1343D6499; Wed, 12 Dec 2001 15:54:42 -0200 (BRST) Received: from ws-tor-0073.procergs.rs.gov.br (unknown [172.28.6.140]) by quebec.procergs.com.br (Postfix) with ESMTP id E0761F0548; Wed, 12 Dec 2001 15:54:41 -0200 (BRST) Message-Id: <5.1.0.14.1.20011212155028.00a64e68@imap.procergs.rs.gov.br> X-Sender: procergs-filipe-brandenburger@imap.procergs.rs.gov.br X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Wed, 12 Dec 2001 15:57:47 -0300 To: Devin Smith From: Filipe Brandenburger Subject: Re: Doing "batch" updates in single-user mode Cc: freebsd-questions@freebsd.org In-Reply-To: <20011212123632.A30468@tharmas.rintrah.org> References: <5.1.0.14.1.20011212135123.00a64e68@imap.procergs.rs.gov.br> <5.1.0.14.1.20011212100146.00a6f420@imap.procergs.rs.gov.br> <5.1.0.14.1.20011212100146.00a6f420@imap.procergs.rs.gov.br> <20011212103624.A10754@tharmas.rintrah.org> <5.1.0.14.1.20011212135123.00a64e68@imap.procergs.rs.gov.br> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed 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 At 12/12/2001 14:36, Devin Smith wrote: >Maybe try > >#!/bin/sh >init 1 && touch /root/I_was_here >exit > > >then run with exec ./scriptname.sh Well, didn't work either. As I'm seeing it, when I run "init 1", it kills all running processes. Then, when all of them are killed, it opens another shell (that's when it asks which shell you want or /bin/sh). When that shell exits, then it's when it gets back to multi-user mode. As I see it, the way to do it would be telling init (somehow) that it would have to open another shell that is not /bin/sh in a non-interactive way, so that you could place a script in /root/update_single_user.sh, and then when the script would go to the single user mode, it would run this script, and when this script finishes, it would get back to multi-user mode. Filipe To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message