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).

Filter by
Sorted by
Tagged with
112
votes
2answers
145k views

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 ...
22
votes
4answers
14k views

New parent process when the parent process dies

In UNIX, when a parent process disappears, I thought that all child processes reset init as their parent. Is this not correct all the time? Are there any exceptions?
89
votes
18answers
39k views

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 (...
91
votes
5answers
95k views

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

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 ...
95
votes
4answers
278k views

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?
27
votes
2answers
56k views

How can I kill a <defunct> 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 <defunct> label appears next to it. If I send a SIGKILL, it still doesn't ...
1
vote
3answers
2k views

Why does `init 0` result in “Excess Arguments” on Arch install?

I am used to the old method of calling init 0 to shutdown. Bad, I know; but when I tried it on my new Arch install I get this: # init 0 Excess Arguments This confuses me because I thought systemd ...
42
votes
5answers
9k views

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 ...
42
votes
4answers
11k views

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) ...
1
vote
3answers
8k views

startx autologin does not run in /etc/inittab in after Debian Jessie update

I installed a minimal Debian system (stable) without GUI, switched to testing/jessie to be able to get the Cinnamon desktop, but X didn't start on boot. If I log in as myself at the CLI, I can type ...
5
votes
1answer
2k views

Linux kernel action upon init process exiting

Say I am writing my own init program running on a Linux kernel. What happens when my init program exits with return value 0 ? Additionally is the behaviour different if the return value is non-zero?
38
votes
5answers
71k views

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 ...
24
votes
3answers
214k views

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-...
4
votes
1answer
4k views

Orphan process's parent id is not 1 when parent process executed from GNOME Terminal

I start a new process from GNOME Terminal and then this process fork a child. But when I killed the parent process the orphaned process's parent id became something other than 1 which represent init -...
23
votes
7answers
30k views

Start tomcat at startup with administrative privileges

I need one process run before log in to system. How to run it like services? how do I make services in Linux? In Ubuntu and Fedora? The service is customized tomcat
17
votes
8answers
9k views

How to read the shut down messages afterwards?

I'm using Lubuntu 11.10. Every time I shut down I can read FAIL in red letters, but I can not read more. So, how to read the log messages and try to solve the problem?
12
votes
2answers
5k views

Can the init process be a shell script in Linux?

I was going through a tutorial on setting up a custom initramfs where it states: The only thing that is missing is /init, the executable in the root of the initramfs that is executed by the ...
3
votes
1answer
266 views

Linux - IPC with init

The init process exists as an ancestor of all of processes on a linux system. Does this process have any kind of IPC entry point ? Do other processes ever do IPC with init for any reason ?
2
votes
2answers
2k views

What is the default path that systemd uses to locate locate System V scripts?

Is /etc/init.d the default search path that the systemd generator uses to convert native SysV script to unit files, and falls back to /etc/rc?.d or vice versa? From this answer by @JdeBP: This ...
1
vote
0answers
378 views

How to determine which init system is used? [duplicate]

Is there a way to determine which init system is being used in Linux? (such as sysvinit, upstart, systemd, etc.) I don't care if it can be programmatically determined, I just want to know how I can ...
0
votes
1answer
2k views

inittab respawn and rc.local

At the moment I have a daemon starting at boot using rc.local by the following line. su -l user -c '/dir/daemon' but I would like to start this process as a service with respawn. I found out that it ...
182
votes
6answers
86k views

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?
38
votes
7answers
49k views

Can root kill init process?

Can root kill init process (the process with pid 1)? What would be its consequences?
7
votes
4answers
7k views

Add item to inittab on OpenSuse 12.1

I am currently working on a project which needs to be added to inittab so that the program loads during startup. The program that I am trying to start is a c# mono application. I have created a ...
13
votes
2answers
50k views

How to find out in which order /etc/init.d scripts are load on Debian?

I want to run one sysvinit script before another and figured out how to do that. To make sure, this actually happens in the the order I like, I would like to see a list, in which order that happens. ...
5
votes
3answers
13k views

Starting Qt Application On Startup for Embedded Linux

I'm trying to get a Qt application to launch immediately after booting up. When booted, the Linux image does nothing more than launch an X server and a terminal. It also has the cron daemon running in ...
4
votes
2answers
5k views

How to disable ctrl-alt-del and /etc/init/control-alt-del.conf in Linux?

My OS is RHEL 6.2 I disable Ctrl+Alt+Del by changing in /etc/init/control-alt-del.conf the line exec /sbin/shutdown -r now "Control-alt-del pressed" by exec /bin/true I'll be testing it next ...
26
votes
1answer
19k views

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 ...
28
votes
1answer
7k views

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 ...
16
votes
1answer
12k views

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, ...
13
votes
4answers
7k views

What can make passing init=/path/to/program to the kernel not start program as init?

I'm trying to debug an init script on a Linux system; I'm trying to pass init=/bin/sh to the kernel to make it start sh without starting init so I can run through the init sequence manually. What I'...
3
votes
3answers
3k views

Why do we need initramfs and initrd

For example we have exotic file system on the disk and in order to load system we need mount root filesystem. But we cannot because there is no suitable driver exists in kernel image. Let me ...
5
votes
1answer
1k views

What does `init [2]` mean in the COMMAND column of ps?

Reading What do the brackets around processes mean? I understand that the executable name is printed. Linux ps man page: Sometimes the process args will be unavailable; when this happens, ps will ...
2
votes
2answers
6k views

Debian init runlevels

It used to be that when you booted most linuxes, you would boot into runlevel 6, unless you did something during the bootloading to change the runlevel,. The process would then look in /etc/init/rcX....
27
votes
2answers
1k views

Can a zombie have orphans? Will the orphan children be disturbed by reaping the zombie?

As I understand it, a zombie process has died but still exists as a placeholder in the process table until its parent (or init if the zombie is itself an orphan) checks its exit status. And my ...
12
votes
1answer
1k views

Why does running `killall init` as user log me out?

On multiple computers running Ubuntu 14.XX, I ran the command "killall init" as user, and was immediately logged out. I could log back in again without a problem. Why is this? What's going on behind ...
4
votes
1answer
5k views

How can you get console backgrounds for Arch Linux?

I have tested out openSUSE and found that the tty1 is a bit different from other systems as the tty has got a background. I know that Knoppix has a tux penguin for each core the computer has, but I'm ...
2
votes
1answer
877 views

Check `fsck` automatically

I need to run fsck so that it automatically fixes problems (i.e., fsck -y). And because I am using "systemd" instead of "init" in the linux system, I cannot modify the /etc/default/rcS. So what ...
7
votes
5answers
17k views

Why is my Debian jessie always in runlevel 5?

I have configured the lines in /etc/inittab as follows: # The default runlevel. id:2:initdefault: But after logging in the output of runlevel is as follows: N 5 So why am I in runlevel 5 instaed ...
5
votes
1answer
1k views

init: is it a user thread or a kernel thread?

init is the first task executed after kernel is loaded, right? Then who is its owner. also I can see [swapper/0] [swapper/1] ..... [swapper/7] having pid 0 PID PPID CPU TASK ST %MEM ...
4
votes
1answer
3k views

How do systemd and chkconfig interact with respect to services and runlevels?

I recently updated some of our machines to Fedora 17. I have noticed that there are some services that I can configure their runlevels using chkconfig, while others don't appear there at all, and can ...
4
votes
3answers
1k views

Shutdown procedure clarification

The book "How Linux Works" says the general shutdown procedure (independent of init system) is something like this: init asks every process to shut down cleanly. If a process doesn’t respond after a ...
4
votes
2answers
3k views

How can I make an executable run as a service?

On Ubuntu 18.04, I can start or stop some service by sudo service cron start/stop I can list some services by service --status-all The output matches the files under /etc/init.d/. I heard there ...
3
votes
1answer
3k views

What is the default /etc/inittab file on a fresh install of Debian Jessie?

I'm looking for the full contents of the default /etc/inittab file on a fresh install of Debian 8.7 before any system-specific modifications are made. I searched for this on the Debian website and ...
2
votes
2answers
2k views

Creating a shutdown only script with update-rc.d

I have a Raspberry PI running the standard Raspbian distribution. I have this little C program that I need to run at the very end of the shutdown sequence. All it does is send a couple of logical high ...
1
vote
2answers
129 views

Splash in PID =1

I have just started learning about process in Linux. I have come around this command called - ps -ef (which will shows all the process running ) I get output like this UID PID PPID LWP ...
0
votes
1answer
157 views

Why is there a `systemd` process owned by each user that is logged in?

In my ps output: root 1 0.0 0.0 225552 5316 ? Ss /lib/systemd/systemd --system --deserialize 19 message+ 572 0.0 0.0 51564 3076 ? Ss /usr/bin/dbus-daemon --system --address=...
0
votes
3answers
47 views

Is telinit run as a daemon?

In sysvinit, telinit is a symlink to init. init is run as a daemon. Is telinit run as a daemon? I don't have sysvinit installed on my Lubuntu. For comparison, systemctl plays similar role to ...
-2
votes
1answer
76 views

In sysvinit, do `telinit` and `init` run in the same process?

In https://manpages.debian.org/stretch/sysvinit-core/init.8.en.html /sbin/telinit is linked to /sbin/init. It takes a one-character argument and signals init to perform the appropriate action. ...