March 29, 2024, 09:20:16 AM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: INIT: /etc/inittab["xx"] : missing action field, /etc/inittab error  (Read 7523 times)

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
Hi,

I have old CentOS 4.6 server and its unable to boot now, I have access to it in Single user mode over KVM and I desperately need help to get it running so that I can take necessary backup, after that I will do OS upgrade and other upgrade such cent os 5.3 etc..

Error I am getting is :
Code: [Select]
INIT: /etc/inittab["line_number"] : missing action field
INIT: /etc/inittab["line_number"] : missing action field
INIT: /etc/inittab["line_number"] : missing action field
"NIT: Cannot Execut /etc/rc.d/rc.sysinit

I looked forum and I found that might be bcz I edited /etc/inittab from windows machine as difference of line handling in windows and linux causes problem.

Prior to this problem, I had upgraded PERL using "CPAN" on my server and added MONIT, for Monit I had added following lines in /etc/inittab as per docs. And it is the only Modification I did to inittab.
Code: [Select]
#For MONIT
mo:2345:respawn:/usr/local/bin/monit -Ic /etc/monitrc

I later removed it using vi over console but still same error. 

Also I had this error lately :
Code: [Select]
INIT: "X" respawning too fast
INIT: "X" respawning too fast
INIT: "X" respawning too fast

but server was running and I had plan to troubleshoot it once I upgrade my perl etc.

but now I am unable to boot.
Below is my /etc/inittab
Code: [Select]
#
# inittab       This file describes how the INIT process should set up
#               the system in a certain run-level.
#
# Author:       Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
#               Modified for RHS Linux by Marc Ewing and Donnie Barnes
#

# Default runlevel. The runlevels used by RHS are:
#   0 - halt (Do NOT set initdefault to this)
#   1 - Single user mode
#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)
#   3 - Full multiuser mode
#   4 - unused
#   5 - X11
#   6 - reboot (Do NOT set initdefault to this)
#
id:3:initdefault:

# System initialization.
si::sysinit:/etc/rc.d/rc.sysinit

l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6

# Trap CTRL-ALT-DELETE
ca::ctrlaltdel:/sbin/shutdown -t3 -r now

#For MONIT
#mo:2345:respawn:/usr/local/bin/monit -Ic /etc/monitrc

# When our UPS tells us power has failed, assume we have a few minutes
# of power left.  Schedule a shutdown for 2 minutes from now.
# This does, of course, assume you have powerd installed and your
# UPS connected and working correctly. 
pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"

# If power was restored before the shutdown kicked in, cancel it.
pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"


# Run gettys in standard runlevels
1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6

# Run xdm in runlevel 5
x:5:respawn:/etc/X11/prefdm -nodaemon


Now I am connect to server over KVM in single user mode.. so wht could be solution ?
Thankyou!

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
Nevermind, I solved it myself with help of a friend. As I guessed, it was due to the fact that I edited /etc/inittab from windows machine, all I am required to save the /etc/inittab back in unix format. There were various ways but easiest one was using vi itself.
Just set VI to save always in Unix mode.
Code: [Select]
:set fileformat=unix
:wq
Now opened that file in vi and saved it, rest was taken care automatically.