version 1.0.0, 2014-07-05 : Initial version
Recovering a lost /etc/init lost directory
This document describes how to recover a lost /etc/init directory in the context of a Red Hat based distribution.-
Add "selinux=0 init=/bin/sh" at the end of the "kernel" line in grub
-
Check if /var/lock is writable via
touch /var/lock/toto
-
If not, remount the filesystem in writable mode via
mount -o rw,remount /
(if your /var is on /…) -
Check which packages are to be reinstalled via
yum -C provides /etc/init*
-
Mount installation CD via
mount -r -t iso9660 /dev/sr0 /mnt
-
Reinstall upstart and initscripts via
rpm -Uv --force --noscripts /mnt/Packages/upstart*.rpm /mnt/Packages/initscripts*.rpm
-
Verify there is no more missing files from the packages via
rpm -V initscripts
andrpm -V upstart
andrpm -Vf /etc/init
-
Unmount CD, eject disk and reboot (unsing
reboot -f
)
Note
You can also boot from the cdrom rescue mode.