12

What file in Ubuntu is equivalent to the /etc/inittab file in RedHat?

In RedHat the /etc/inittab file contains the settings related to the runlevel in which you want to boot Linux.

3 Answers 3

10

Ubuntu uses Upstart, an alternative to sysvinit, which works completely differently. The Upstart CookBook discusses runlevels and how to work with them.

Generally, though, the RedHat concept of runlevels isn't used on Debian or derivatives, including Ubuntu; they have only "single user" or "everything running", without any of the "network, but not graphics" style distinctions that RedHat draws.

1
  • There are 3 paradigms to manage services in Ubuntu. System V init, upstart and systemd. As of Ubuntu 18.04, it is systemd. Commented Aug 21, 2018 at 6:14
6

As mentioned Ubuntu does now use Upstart.

The /etc/inittab and the scripts from /etc/init.d or /etc/rc.d/* have been incorporated into several scripts in the /etc/init directory or /etc/event.d (for older versions of Upstart).

Look for the item you want to modify to have a script in that directory, (serviceX) /etc/init/serviceX.conf and modify it accordingly. You can find the syntax and additional information online.

However, if you need to run a program that depends on SysV Upstart has a compatibility mode. Programs that still use /etc/rc.d/* can put scripts in there and have them still run.

As I was looking at the scripts in /etc/init, there was one named rc-sysinit.conf - and it provides the ability to parse the /etc/inittab and determine the default runlevel from this file should you add one.

2

If you want to change the default-runlevel of your Ubuntu system and looking for the /etc/inittab go change it and see that Ubuntu lacks it, don't worry(!), to do so you you can create inittab file in /etc directory and write only the following line on it:

id:3:initdefault:

(you can change "3" to your intended default rullevel)

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.