From owner-freebsd-questions@FreeBSD.ORG Tue Apr 22 00:37:52 2003 Return-Path: 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 0AB5537B401 for ; Tue, 22 Apr 2003 00:37:52 -0700 (PDT) Received: from grillolja.cs.umu.se (grillolja.cs.umu.se [130.239.40.17]) by mx1.FreeBSD.org (Postfix) with ESMTP id E43F143FA3 for ; Tue, 22 Apr 2003 00:37:50 -0700 (PDT) (envelope-from tdv94ped@cs.umu.se) Received: from localhost (localhost [127.0.0.1]) by amavisd-new (Postfix) with ESMTP id 4562A9F36; Tue, 22 Apr 2003 09:37:49 +0200 (MEST) Received: from kvist.cs.umu.se (kvist.cs.umu.se [130.239.40.192]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by grillolja.cs.umu.se (Postfix) with ESMTP id 427719F22; Tue, 22 Apr 2003 09:37:45 +0200 (MEST) Date: Tue, 22 Apr 2003 09:37:44 +0200 (MEST) From: Paul Everlund To: Willie Viljoen In-Reply-To: <200304220821.00090.will@unfoldings.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new cc: questions@FreeBSD.ORG cc: jemaxwell@jaymax.com Subject: Re: Restarting init without rebooting X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2003 07:37:52 -0000 On Tue, 22 Apr 2003, Willie Viljoen wrote: > On Tuesday 22 April 2003 7:39, someone, possibly Sunil Sunder Raj, > typed: > (Top post moved to bottom) > > >There is supposed to be a way of restarting init, after > > >modifications of say an rc.* file, by sending a SIGHUP, I think > > >avoiding the need to reboot. > > > > kill -HUP pid > > wher pid is the pid of the inetd process. > > Sunil, this is to restart the internet super server (inetd). Joe > wanted to restart init (the stage of booting and system management > just after the kernel) If you type 'kill -HUP 1' the init-process reads some (do not know which except for /etc/ttys) configuration files. > Joe, sadly BSD init will not restart as some SysV flavours will do, > however, if you are at the console (NOT over a network connection, > but a serial console counts too), there is a way to emulate the > behaviour you would get from a SysV init. > > First, as root, do this (note the omission of switches): > > # shutdown now > > The system should now kill off processes and if your console is set > to be insecure in /etc/ttys(5), init will ask for your root password > to enter single user mode. > > Now you will be asked for a shell. Normally I prefer csh, but I'd > recommend going with the defeault of /bin/sh for single user mode, > various reasons. > > Once in single user mode, you will see: > > # > > Now, your only real option is to conduct some single user operations > on the system, and reboot. You may also reinvoke rc however. Note > that this can be troublesome, as some things in system startup > really need only happen once. If you want to do this, first make > sure to unmount all file systems in fstab(5), except for root. Do > this: > > # umount -A > > Now, to attempt the restart, enter: > > # sh /etc/rc > > It's important that you use sh here. Even if you selected to use csh > for your shell, you MUST invoke /etc/rc with sh. > > The system should now start performing the general booting > procedures. This is pretty much a reboot, but it won't kill your > uptime (which I am assuming is what you wish to preserve) > > Give this a try. > Will Can one not accomplish this by 'killall init'? Then enter for '/bin/sh', and when typing exit the rc-scripts seems to be read once again. This must of course be done at the console. Best regards, Paul