Date: Thu, 5 Aug 1999 08:46:32 +1000 From: Peter Jeremy <jeremyp@gsmx07.alcatel.com.au> To: FreeBSD-gnats-submit@FreeBSD.ORG Subject: bin/12976: No backup init(8) kept during installworld Message-ID: <99Aug5.082711est.40331@border.alcanet.com.au>
next in thread | raw e-mail | index | archive | help
>Number: 12976
>Category: bin
>Synopsis: No backup init(8) kept during installworld
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Wed Aug 4 15:50:01 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator: Peter Jeremy
>Release: FreeBSD 4.0-CURRENT i386
>Organization:
Alcatel Australia Limited
>Environment:
cvs-cur 5539
>Description:
init(8) is a critical part of the system startup - if no
suitable init can be found, the kernel will panic. It's
also the only critical file which is automatically updated
during an installworld without any backup being kept.
When a new kernel is installed, the current kernel is kept as
/kernel.old. Similarly, the old /boot/loader is kept as
/boot/loader.old. Whilst /bin/sh is not backed up, /bin/csh
and /stand/sh (the latter is unaffected by installworld) are
available as alternatives. [If wanted, something very similar
to the patch below should also apply to /src/bin/sh/Makefile].
During startup, the kernel will scan a range of pathnames
(/sbin/init, /sbin/oinit, /sbin/init.bak, /stand/sysinstall
by default), and this can be over-ridden from /boot/loader
with the init_path environment variable.
It therefore seems reasonable to save the existing (working)
init in case the new one is faulty in some way.
>How-To-Repeat:
Code inspection.
cd .../src/sbin/init; make install
>Fix:
Index: Makefile
===================================================================
RCS file: /home/CVSROOT/./src/sbin/init/Makefile,v
retrieving revision 1.17
diff -u -r1.17 Makefile
--- Makefile 1999/07/01 13:33:56 1.17
+++ Makefile 1999/08/04 22:22:54
@@ -33,3 +33,10 @@
.endif
.endif
+
+# Backup existing /sbin/init as /sbin/oinit in case the new one blows up
+.if exists(${DESTDIR}${BINDIR}/${PROG})
+beforeinstall:
+ -chflags noschg ${DESTDIR}${BINDIR}/${PROG}
+ mv ${DESTDIR}${BINDIR}/${PROG} ${DESTDIR}${BINDIR}/o${PROG}
+.endif
--
Peter Jeremy (VK2PJ) peter.jeremy@alcatel.com.au
Alcatel Australia Limited
41 Mandible St Phone: +61 2 9690 5019
ALEXANDRIA NSW 2015 Fax: +61 2 9690 5982
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?99Aug5.082711est.40331>
