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

learn more… | top users | synonyms

65
votes
4answers
27k 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?
35
votes
4answers
38k 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?
29
votes
4answers
2k 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) ...
21
votes
7answers
26k 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
21
votes
3answers
983 views

If computers start counting at 0, why does the init process have a pid of 1?

Not much to put here in the body, the question is self explanatory.
20
votes
1answer
1k 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 ...
17
votes
7answers
14k views

Can root kill init process?

Can root kill init process (the process with pid 1)? What would be its consequences?
14
votes
1answer
4k 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 ...
14
votes
2answers
20k 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 ...
11
votes
8answers
1k 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 now uses systemd, Ubuntu uses Upstart, while others use ...
7
votes
1answer
555 views

Why does “kill -9 0” end my console session?

I just wonder why kill -9 0 ends my tty console session? What exactly is PID 0, it is not listed on a ps aux?
7
votes
4answers
4k 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 ...
7
votes
2answers
9k views

Launch process as another user/group (in init.d script)

I am editing a init.d script. The init.d script runs a utility script which then runs an process. From either bash scripts how would I make it launch the main process as a specific user and group?
6
votes
3answers
8k views

File in Ubuntu equivalent to /etc/inittab file in RedHat

I searched a lot but can't get any solution. My question is what file in Ubuntu is equivalent to /etc/inittab file in RedHat. In RedHat /etc/inittab file contains the setting related to runlevel in ...
6
votes
1answer
2k views

How Do I Add My Own Daemons in Arch Linux? (BSD-style init)

I have created a symlink to a start/stop/etc. wrapper bash script in /etc/rc.d, added it to DAEMONS=() in rc.conf, but the process it points to isn’t starting on boot, and isn’t showing up in the ...
6
votes
2answers
1k 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 ...
5
votes
2answers
458 views

What happens if I set default system runlevel to 0 or 6?

What I understand from runlevels is that in each level some programs have permission to be executed and some don't. runlevel 3 boots system into CLI and runlevel 5 starts the default GUI. But I don't ...
5
votes
1answer
917 views

What will happen if I run the command init in my Ubuntu Gnome terminal?

command init seems to be the first process running after each booting. If I init in my Ubuntu Gnome terminal, will that restart my OS?
5
votes
1answer
235 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 ...
5
votes
1answer
165 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 ...
5
votes
1answer
427 views

inittab '-' character in process field

I have a an inittab file with the following entry: console::askfirst:-/bin/ash According to this Man page a '+' character in the process field means init will not do utmp and wtmp accounting ...
5
votes
2answers
16k 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 ...
5
votes
2answers
404 views

Why is a service being started if it isn't mentioned in /etc/init.d?

After a clean install of Fedora 17 and distcc-server, I did a service distccd start, which completed successfully. man service indicates that it would merely be running the distccd script at ...
5
votes
2answers
547 views

How do I start my service at boot-time?

I'm trying to run a CherryPy app on my NetBSD 5.1 box. To have it start automatically, I've added this line to my /etc/rc.local: /bin/httpd & When I boot the machine, some of the output of the ...
5
votes
1answer
3k 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 ...
4
votes
2answers
476 views

When running to a run level does it execute previous run levels?

If I tell my system to go to run level 3 does that mean that it first runs through run level 0, 1, 2, and then finally runs through run level 3? I thought the answer to this question was yes. But ...
4
votes
2answers
2k views

Why does debian and ubuntu default to runlevel 2?

I never thought about this before, but I was wondering why they chose runlevel 2. Every other distro and OS I've used default to runlevel 3 (with the exception of AIX which also defaults to runlevel ...
4
votes
1answer
260 views

How does init determine which devices to modprobe?

I'm building a totally custom initramfs for a netbooting project and in the process learning a lot about it, but I'm a little puzzled by the loading of modules. I know modprobe can be used to load ...
4
votes
1answer
3k 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. ...
3
votes
5answers
3k views

How can I run a daemon with custom parameters

I am wondering how I can run a daemon, in this case NTP, with custom parameters. For example in my Ubuntu PC I observe that I've got ntpd running this way: $ ps aux | grep ntpd ntp 5936 ... 0:00 ...
3
votes
3answers
104 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?
3
votes
1answer
601 views

How to trick an init script into returning 0

I have a init script which is poorly designed because it does not conform to the Linux Standard Base Specifications The following should have an exit code of 0 if running, and 3 if not running ...
3
votes
1answer
190 views

Rolling your own init: How to shutdown/restart?

After reading this answer, I thought it would be funny to roll my own init on Python, so I wrote this in /init-python. #!/usr/bin/python3 import os import subprocess # Make / writable! ...
3
votes
1answer
643 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 ...
3
votes
1answer
89 views

SIGKILLing after a grace period

I've seen a lot of process managers that try to do this. It was my understanding that you should only use SIGTERM to kill a process. The process could take an unknown amount of time to clean up after ...
3
votes
1answer
390 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, ...
3
votes
1answer
175 views

Init script leaves thousands of defunct processes

My problem is that I have an init script that is generating thousands of defunct bash processes. My goal is to have a program called "fr24feed" in its own screen session on boot. After looking at ...
3
votes
1answer
305 views

Minimal Linux with kernel and BusyBox: /etc/inittab is ignored, only /init is executed

I managed to create a small and fully functional live Linux CD which contains only kernel (compiled with default options) and BusyBox (compiled with default options + static, all applets present, ...
2
votes
2answers
2k views

autossh in /etc/inittab

I have setup ssh tunnel to be able to connect a target computer behind NAT. I have put the following into /etc/inittab on the computer: tu:2345:respawn:/usr/bin/autossh -M 20000 -f -n -N -T -R ...
2
votes
1answer
441 views

Ubuntu 11.04 Startup Applicatation vs /etc/init.d

Is there any difference between these two methods for application to start on boot? I need an application to start before a logon occurs and am questioning whether or not Ubuntu's Startup Application ...
2
votes
1answer
125 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 ...
2
votes
1answer
158 views

Why is the restart inittab action asking me for an id?

I am following the NAND firmware update tutorial to try to get my system to run from RAM so I can flash it. I previously had my script running but for some reason unknown to me it is giving me: INIT: ...
2
votes
2answers
162 views

How to turn off single user mode on a remote machine?

I have a linux machine that I was accessing remotely and I made the mistake of doing #init 1 which turned off networking on the machine. What is the easiest way to turn networking back on and/or get ...
2
votes
2answers
853 views

`[java] <defunct>` with defunct children -> Any way to collect them?

Relating to question : What if 'kill -9' doesn't work? I have following situation : zombie process with threads, not collected by init : [root@Arch64]# ps auxH | grep java gwpl 569 ...
2
votes
2answers
88 views

disabling ctrl-alt-del and /etc/init

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 ...
2
votes
1answer
127 views

How do I set cron to run on background?

I am on ubuntu 12.04 and following this tutorial. I want to setup cron to run in the background but I don't have a chckconfig in sbin so I can't run sudo /sbin/chkconfig crond on I am fairly new to ...
2
votes
1answer
78 views

Application lags if started from init.d?

I have a program (pre-compiled binary) that, when started manually on linux, runs fine. It has a CLI that I use to enter commands. This program is a software router, I can connect to it's CLI to ...
2
votes
2answers
799 views

Sabayon - mysql (and other services) won't start

It's a fresh install of Sabayon Linux. I installed mysql (equo install dev-db/mysql), configured it (emerge --config ...), but it doesn't start using /etc/init.d script: # /etc/init.d/mysql start * ...
2
votes
1answer
499 views

Why can't boot this process at launch?

I have two scripts /etc/init.d/puma_a.sh and /etc/init.d/puma_b.sh with identical configs. I try to set both boot like this, but one of them doesn't load on boot. If I manually launch it from console ...
2
votes
1answer
61 views

How do I identify on my system after successful boot. weather it was crash or was it a shutdown or reboot or something else?

Depending on the restart of the system, I need to make my application taking some follow up. my system is get restarted as following: my self as system admin rebooting sudo init 6 or sudo reboot my ...