Hi all,
I can not figure out what is mean "null" on the beginning line in file /etc/inititab?
null::sysinit:/etc/init.d/rcS
Can anybody help me?
Welcome @blazic016,
null is the unique ID of the entry. It has no special meaning and is only used by sysvinit to identify the entries for further processing when it reads in inittab. You can list all IDs e.g. with
grep -Ev '^(#|$)' /etc/inittab | cut -d: -f1 | sort
See also man inittab.
Thanks,
But, what is the difference if I write with null and without null?
Because I am noticed that if exist "null" then the rcS script not will be running.
If I remove "null" then the rcS script will be started.
which version of sysvinit do you have installed?
If you remove the ID, sysvinit should ignore the entry because a unique ID must exist. Maybe you have another sysinit:/etc/init.d/rcS entry?
I don't have sysvinit.
I use Linux on board which is genereted by buildroot.
I lack understanding, my conclusion is that the rcS script will be running if remove null.
and if exist null rcS script will not be running, and in this case, I can't use the command console (freeze console)
Hello,
I don't think that's quite correct, no. If you look at the man page for inittab, you'll see something like this:
DESCRIPTION
The inittab file describes which processes are started at bootup and during normal operation (e.g. /etc/init.d/boot, /etc/init.d/rc, get-
tys...). Init(8) distinguishes multiple runlevels, each of which can have its own set of processes that are started. Valid runlevels are
0-6 plus A, B, and C for ondemand entries. An entry in the inittab file has the following format:
id:runlevels:action:process
Lines beginning with '#' are ignored.
id is a unique sequence of 1-4 characters which identifies an entry in inittab (for versions of sysvinit compiled with the old libc5
(< 5.2.18) or a.out libraries the limit is 2 characters).
Note: traditionally, for getty and other login processes, the value of the id field is kept the same as the suffix of the corre-
sponding tty, e.g. 1 for tty1. Some ancient login accounting programs might expect this, though I can't think of any.
So, as per bendingrodriguez's explanation, the first field of an inittab entry is the identifier of that entry. Each entry must have a unique ID. If an entry does not have an ID, it will not be run, because the line will not be regarded as a correctly-formatted inittab entry.
The fact that the identifier in this line is null has no special meaning. It could be a numerical identifier like 1, 2 and so on; or another bit of text entirely, like abc or foo. As long as it is a unique identifier consisting of no more than 4 characters, then the entry will be regarded as valid by init and will be processed accordingly.
that's a non-distro system, you should have mentioned that. If the system doesn't use sysvinit as init system, it will be busybox, and that reads in inittab in a non-traditional way:
https://buildroot.org/downloads/manual/manual.html#_init_system
https://git.busybox.net/busybox/tree/examples/inittab
big big big THANKS @bendingrodriguez
You saved my life!