From owner-freebsd-questions@FreeBSD.ORG Mon Apr 21 23:21:43 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 AEF0337B401 for ; Mon, 21 Apr 2003 23:21:43 -0700 (PDT) Received: from apollo.laserfence.net (apollo.laserfence.net [196.44.69.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1251F43FE0 for ; Mon, 21 Apr 2003 23:21:41 -0700 (PDT) (envelope-from will@unfoldings.net) Received: from localhost ([127.0.0.1]) by apollo.laserfence.net with esmtp (Exim 4.10) id 197r9j-000HT5-00; Tue, 22 Apr 2003 08:21:27 +0200 Received: from prometheus-p0.datel.laserfence.net ([192.168.255.1] helo=prometheus.home.laserfence.net) by apollo.laserfence.net with esmtp (Exim 4.10) id 197r9R-000HSu-00; Tue, 22 Apr 2003 08:21:11 +0200 Received: from phoenix.home.laserfence.net ([192.168.0.2]) by prometheus.home.laserfence.net with esmtp (Exim 4.10) id 197r9J-0005wQ-00; Tue, 22 Apr 2003 08:21:01 +0200 Received: from will by phoenix.home.laserfence.net with local (Exim 4.10) id 197r9I-0002J3-00; Tue, 22 Apr 2003 08:21:00 +0200 From: Willie Viljoen To: "Sunil Sunder Raj" , jemaxwell@jaymax.com Date: Tue, 22 Apr 2003 08:20:59 +0200 User-Agent: KMail/1.5.1 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200304220821.00090.will@unfoldings.net> Sender: Willie Viljoen X-Spam-Score: (/) X-Scanner: exiscan for exim4 (http://duncanthrax.net/exiscan/) *197r9R-000HSu-00*nEilmc9Kn2Q* X-Virus-Scanned: by AMaViS snapshot-20020422 cc: questions@FreeBSD.ORG 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 06:21:44 -0000 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) 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 -- Willie Viljoen Freelance IT Consultant 214 Paul Kruger Avenue, Universitas Bloemfontein 9321 South Africa +27 51 522 15 60 +27 51 522 44 36 (after hours) +27 82 404 03 27 (mobile) will@unfoldings.net