Search:  
Gentoo Wiki

TIP_Repair_Broken_runlevel_in_rc-update

This article is part of the Tips & Tricks series.
Terminals / Shells Network X Window System Portage System Filesystems Kernel Other

Introduction

This tip is intended to fix a problem you may encounter with your runlevel configuration where you see variants on the following errors..


* Broken runlevel entry: /etc/runlevels/boot/bootmisc
* Broken runlevel entry: /etc/runlevels/boot/checkroot
* Broken runlevel entry: /etc/runlevels/boot/consolefont
* Broken runlevel entry: /etc/runlevels/boot/keymaps
* Broken runlevel entry: /etc/runlevels/boot/modules
* Broken runlevel entry: /etc/runlevels/boot/rmnologin
* Broken runlevel entry: /etc/runlevels/boot/urandom
* Broken runlevel entry: /etc/runlevels/boot/checkfs
* Broken runlevel entry: /etc/runlevels/boot/clock
* Broken runlevel entry: /etc/runlevels/boot/hostname


To resolve these errors you simply need to remove and add each runlevel using

rc-update del checkroot && rc-update add checkroot boot


Get it done quickly!

Thanks to noOneCares there are a couple of commands you can run to check and then fix all of these errors..

To check things are being detected correctly..

for entry in `rc-update show| grep Broken|sed 's/entry: /\n/g'|grep "/etc" |sed 's/\/etc\/runlevels\///g'`; do runlevel=`echo $entry|sed 's/\//\n/g'|head -n1`; service=`echo $entry|sed 's/\//\n/g'|tail -n1`; echo "rc-update del $service $runlevel"; echo "rc-update add $service $runlevel"; done

Check everything matches up with the reported errors then to repair them use...

for entry in `rc-update show| grep Broken|sed 's/entry: /\n/g'|grep "/etc" |sed 's/\/etc\/runlevels\///g'`; do runlevel=`echo $entry|sed 's/\//\n/g'|head -n1`; service=`echo $entry|sed 's/\//\n/g'|tail -n1`; rc-update del $service $runlevel; rc-update add $service $runlevel; done

Alternatively zirkelad shows how to do it with awk...

awk -F '/' '/$/ {print "rc-update del " $5 " " $4 "\nrc-update add " $5 " " $4}'
Retrieved from "http://www.gentoo-wiki.info/TIP_Repair_Broken_runlevel_in_rc-update"

Last modified: Fri, 05 Sep 2008 08:46:00 +0000 Hits: 1,302