My *nix world

System recovering after accidentally removing sysvinit

In Unix-based computer operating systems, init (i.e. initialization) is the first process started during booting of the computer system. It is just a daemon that is starting just after the kernel and which reads the /etc/inittab file in order to know what programs/daemons to start and/or what else to do.

On Gentoo the package that installs this program is called sys-apps/sysvinit.

(i) If you have accidentally removed the package and forgot to re-emerge again

and

(ii) if you have rebooted your system

then you are screwed.

At boot-time, after the kernel is decompressed and loaded, the first program that is loaded is init. If it's missing then your console will display a message like this:

sh: cannot set terminal process group (-1): Inappropriate ioctl for device
sh: no job control in this shell
sh-4.2# _

If you take a look at your /etc/inittab file then you will see exactly what commands your init program, if it still exists, should run (read more here). By running manually these commands you can recover your system.

The following commands help you recovering after accidentally removing sysvinit:

/sbin/rc sysinit
/sbin/rc boot
/sbin/rc default
/sbin/agetty 38400 tty1 linux

The first command initialize the devices. The second one starts those daemons which normally start at boot-time. The third one starts those daemons which should start with a normal user. The last command just open a TTY console.

After you have run each of these commands try to re-emerge your sysvinit or whatever package you need. It should be fine...

Now, if you think that this article was interesting don't forget to rate it. It shows me that you care and thus I will continue write about these things.

The following two tabs change content below.
System recovering after accidentally removing sysvinit

Eugen Mihailescu

Founder/programmer/one-man-show at Cubique Software
Always looking to learn more about *nix world, about the fundamental concepts of math, physics, electronics. I am also passionate about programming, database and systems administration. 16+ yrs experience in software development, designing enterprise systems, IT support and troubleshooting.
System recovering after accidentally removing sysvinit

Latest posts by Eugen Mihailescu (see all)

Tagged on: ,

Leave a Reply

Your email address will not be published. Required fields are marked *