Questions tagged [init]

init is the first actual process (PID 1) spawned during the boot sequence of a UNIX system. Some systems may rely on alternative solutions such as systemd or Upstart (Ubuntu).

init is the first (daemon) process spawned during the boot sequence of a UNIX system. It is initiated by the kernel, which will panic if the init executable cannot be found.

This process has some particular characteristics:

  • While there is no design rule behind this, the init process has PID 1, since it is the first child of process 0 (swapper or sched).
  • init adopts all orphan processes in the system.
  • init handles all operations related to programs starting at boot time. This behaviour can be configured through the /etc/rc* files and directories.

Further reading

348 questions
196
votes
6 answers

What are the pros/cons of Upstart and systemd?

It appears systemd is the hot new init system on the block, same as Upstart was a few years ago. What are the pros/cons for each? Also, how does each compare to other init systems?
tshepang
  • 64,472
  • 86
  • 223
  • 290
174
votes
2 answers

How does systemd use /etc/init.d scripts?

I just switched to debian jessie, and most things run okay, including my graphical display manager wdm. The thing is, I just don't understand how this works. Obviously my /etc/init.d/wdm script is called, because when I put an early exit in there,…
Martin Drautzburg
  • 2,498
  • 3
  • 16
  • 18
141
votes
4 answers

What is the difference between reboot , init 6 and shutdown -r now?

I just want to know difference between in reboot init 6 shutdown -r now and which is the safest and the best?
Rahul Patil
  • 24,281
  • 25
  • 80
  • 96
107
votes
22 answers

Detect init system using the shell

This may have more to do with detecting operating systems, but I specifically need the init system currently in use on the system. Fedora 15 and Ubuntu now use systemd, Ubuntu used to use Upstart (long time default until 15.04), while others use…
beatgammit
  • 7,453
  • 10
  • 31
  • 32
102
votes
5 answers

How to find out if a system uses SysV, Upstart or Systemd initsystem

Is there a simple way to find out which initsystem is being used e.g by a recent Debian wheezy or Fedora system? I'm aware that Fedora 21 uses systemd initsystem but that is because I read that and because all relevant scripts/symlinks are stored…
Valentin Bajrami
  • 9,244
  • 3
  • 25
  • 38
56
votes
5 answers

How to disable X server autostart in Debian Jessie?

I have a remote machine running Debian 8 (Jessie) with lightdm installed. I want it to start in no-GUI mode, but I don't want to remove all X-related stuff to still be able to run it though SSH with the -X parameter. So how to disable X server…
Sai Kurogetsu
  • 563
  • 1
  • 5
  • 6
53
votes
4 answers

Is there any UNIX variant on which a child process dies with its parent?

I have been studying the Linux kernel behaviour for quite some time now, and it's always been clear to me that: When a process dies, all its children are given back to the init process (PID 1) until they eventually die. However, recently, someone…
John WH Smith
  • 15,500
  • 6
  • 51
  • 62
48
votes
5 answers

What exactly does init do?

I am creating a linux distro and now I need an init program. I can code in c really well and I know quite a bit about linux (not much but I've been using arch linux for development for 4 years), so I thought I should try writing my own basic init…
DividedByZero
  • 591
  • 1
  • 5
  • 7
45
votes
7 answers

Can root kill init process?

Can root kill init process (the process with pid 1)? What would be its consequences?
Dharmit
  • 4,220
  • 7
  • 28
  • 37
34
votes
2 answers

When would you use pivot_root over switch_root?

I'm wanting to understand the Linux init process better in order to netboot a system over ceph rather than nfs. In the process I've come across two forms of switching root. One called switch_root, and the other called pivot_root. These scripts…
hookenz
  • 1,207
  • 1
  • 15
  • 19
33
votes
1 answer

How does systemd survive a kill -9?

Between the recent "Why does 'kill -9 0' end my console session" and "How to get a kernel panic" questions, I got a bur under my saddle and tried kill -9 1 on a mostly up-to-date Arch linux laptop. I did it as user ID "root". I fully expected some…
user732
31
votes
2 answers

init process: ancestor of all processes?

I have always learned that the init process is the ancestor of all processes. Why does process 2 have a PPID of 0? $ ps -ef | head -n 3 UID PID PPID C STIME TTY TIME CMD root 1 0 0 May14 ? 00:00:01…
Mathieu Larose
  • 413
  • 1
  • 4
  • 5
29
votes
4 answers

Running a systemd service as a user other than root!

I created the following service, amos.service, and it needs to run as amos (member of the amos group) [Unit] Description=AMOS…
itprguy
  • 293
  • 1
  • 3
  • 5
29
votes
3 answers

How to fix boot into initramfs prompt and "mount: can't read '/etc/fstab': No such file or directory" and "No init found"?

Installing a new system using a GPT partitioned disk dedicated to a single partition, ext4 formatted, extlinux (version 4.05) as bootloader, Ubuntu Core version 13.10 amd64 as rootfs, and Ubuntu linux-image-3.11.0-18-generic as kernel, and…
Pro Backup
  • 4,686
  • 12
  • 50
  • 82
28
votes
3 answers

How can I kill a process whose parent is init?

Transmission is intermittently hanging on my NAS. If I send SIGTERM, it doesn't disappear from the process list and a label appears next to it. If I send a SIGKILL, it still doesn't disappear and I can't terminate the parent because the…
Andy E
  • 659
  • 2
  • 8
  • 16
1
2 3
23 24