2

After a reboot of a CentOS 6.2 server we are getting a kernel panic with the following error:

Kernel panic - not syncing: Attempted to kill init!
Panic occurred, switching back to text console

When passing init=option selinux=0 to the kernel at boot the server will boot without a problem. I have tried searching for what init=option does but I have not been able to find any recourses explaining it.

  • Could someone explain what this parameter does?
  • Also, as this is a production server are there any negatives/risks in running with the init=option?

I have tried to remake the initramfs via dracut which did not work and received the above error upon boot.

As this is a clustered server and the primary server should be identical I have copied the /boot drive from the other server but this did not solve the problem either. (The other server does not have this behavior)

Restoring /boot from backup did not work either.

Could you please help me investigate this problem

  • What causes this kernel panic?
  • How would you go about resolving this issue?
  • What logs (if any) would tell you more information?
  • As this is an older install, would an update/upgrade potentially fix this issue?

I would also like to add that the only other possible related issue was that the root disk which was raid mirrored failed and was replaced before this happened.

Thanks for your help!

Tbuermann
  • 41
  • 1
  • 1
  • 3

2 Answers2

2

Note to self, and everyone else:

Make sure you type disabled instead of disable when you give up and instead decides to disable selinux!

cat /etc/sysconfig/selinux

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=TAKE_A_CLOSE_LOOK_AT_THIS_VALUE

A typo in the SELINUX value will cause a kernel panic.

moander
  • 217
  • 2
  • 4
0

The init=option is a warning message it is not an actually command you should use.

Init options

The init process is the first to be started by the kernel and is the ancestor of all other processes. These options control which program is run and how it is run. Name

init — Program to run at init time. Synopsis

init= filename

Run the specified binary as the init process instead of the default /sbin/init program. Name

http://oreilly.com/linux/excerpts/9780596100797/kernel-boot-command-line-parameter-reference.html

You use init to specify the initial command to be ran by the kernel. You can often set this to init=/bin/bash or init=/bin/sh if things are not booting correctly.

The option part of the notice is the path to the file you want to execute.

If the system boots without SELinux, then I suspect something happened to the SELinux settings. Debugging that can be complicated.

jeffatrackaid
  • 4,112
  • 18
  • 22
  • Disabling SELinux fixed the problem. Thanks for your help. – Tbuermann Jun 10 '14 at 14:57
  • 1
    Disabling SELinux is not a solution, it's a troubleshooting step to determine if SELinux is the problem or not. You would be better to get into Rescue Mode, enter the chroot, and `restorecon -R /` to reset all security contexts to their default values, then rebuild the initrd and try booting again. Don't leave your server with SELinux disabled, this is unsecure and neglectful. – suprjami Nov 21 '14 at 22:26