From owner-freebsd-questions Fri Sep 20 1:26:45 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4326337B4E6 for ; Fri, 20 Sep 2002 01:26:43 -0700 (PDT) Received: from lurza.secnetix.de (lurza.secnetix.de [212.66.1.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2ACAB43E4A for ; Fri, 20 Sep 2002 01:26:42 -0700 (PDT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [IPv6:::1]) by lurza.secnetix.de (8.12.5/8.12.5) with ESMTP id g8K8QemC095386 for ; Fri, 20 Sep 2002 10:26:41 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.12.5/8.12.5/Submit) id g8K8QeqO095385; Fri, 20 Sep 2002 10:26:40 +0200 (CEST) Date: Fri, 20 Sep 2002 10:26:40 +0200 (CEST) Message-Id: <200209200826.g8K8QeqO095385@lurza.secnetix.de> From: Oliver Fromme To: freebsd-questions@FreeBSD.ORG Reply-To: freebsd-questions@FreeBSD.ORG Subject: Re: Restart multi-user mode automatically In-Reply-To: <200209191140.g8JBeeam051096@lurza.secnetix.de> X-Newsgroups: list.freebsd-questions User-Agent: tin/1.5.4-20000523 ("1959") (UNIX) (FreeBSD/4.6-STABLE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit 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 Sorry for replying to myself, but I wanted this to make it into the list archive, in case someone else is having the same problem some day ... Oliver Fromme wrote: > This might seem like a strange question, but maybe someone > has an answer or idea ... > > Under certain circumstances, I need to restart a machine's > multi-user mode without manual intervention. In other words, > it should perform a shutdown, killing all processes, but then > (instead of prompting for a single-user mode shell), the system > should get back up into multi-user mode automatically (running > /etc/rc etc). I do not want to perform a full reboot. > > Is there a way to do that? I finally took an hour to study the source code of /sbin/init. There doesn't seem to be a way to do what I need, because there is no state transition multiuser -> death -> multiuser without a singleuser in between. :-( So the answer to my question is "no". However, from looking at the source code it seems to be pretty easy to write a small tool that "simulates" parts of init and performs exactly what I need. That's what I will do. Regards Oliver PS: No, it is _not_ for avoiding a reboot to save the machine's uptime, but to keep downtimes of services to the absolute minimum possible. A reboot takes several minutes, but shutdown -> ^D -> multiuser is a matter of seconds. -- Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "All that we see or seem is just a dream within a dream" (E. A. Poe) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message