- [Instructor] Let's talk a little bit more about booting.
So GRUB passes control to the kernel,
giving it its command line arguments
and telling it where in memory GRUB loaded
the initial RAM file system,
if there is one.
That initial RAM file system or initial RAM disk
might have a root file system on it
and that might get mounted first.
And an init from that could run,
perhaps loading some loadable kernel modules
that were in that image,
that might be required
to be able to mount your real root file system.
If your kernel was not built with support
for say the kind of device
that holds your root file system,
then that support could be loaded via the initramfs.
The Linux kernel then kind of by hand
creates the very first process.
So that process will have process ID one.
And in the kernel source code, it looks for a program
and a couple of places with the name init,
and that's what it's going to start.
And if it doesn't find something called init,
then it'll try to start a shell.
In my experience, if it can't find init,
it's not going to be able to find a shell
because something was seriously wrong.
And although you might have the name init,
it might be a link.
Like these days, init probably is a link
to the systemd program.
So systemd will be the very first process.
And the init program, like systemd,
is then responsible for starting up everything else.
So it's the ancestor of all processes,
maybe the great-grandfather or great-great-grandfather,
but it's back there as an ancestor.
So it starts up Daemons, it starts up whatever you need
to be able to log in and so forth.
So of course, as Linux has evolved,
how all that work has evolved.
It used to be services underneath etc/rc.d,
but these days, most Linux systems use systemd,
and there's lots of service files
and you can go look at some
by looking at etc/systemd/system.
And there's other places on your system
where the services might be,
but that's configured just start up stuff,
like your web server.
So these are user-space services, remember.
These are not parts of the kernel.
The kernel's job was to get systemd running
and then systemd takes it from there.