Friday, August 28, 2015

Init,Systemd, and Upstart

init?

In Linux, init is a abbreviation for Initialization. The init is a daemon process which starts as soon as the computer starts and continue running till, it is shutdown

If somehow init daemon could not start, no process will be started and the system will reach a stage calledKernel Panic. init is most commonly referred to as System V init. 

  • The SysV and LSB mainstay
/etc/inittab
 - calls the scripts for each runlevel

/etc/init.d/rc
  -followed by a number for the runlevel

Each runlevel has a directory of scripts
 -When entering the runlevel, start S scripts
 -When existing the runlevel, stop the K scripts

Distros using SysV init would have several directories under /etc such as rc0.d, rc1.d, through rc6.d for each runlevel.Under each of the directories, you'd have a set of symbolic links that point back to scripts that include startup and shutdown directives for services like Apache and the SSH daemon. Each link has a name like KNNsshd or SNNcups, where the NN determines the order in which services are killed (K) or started (S). 

Upstart

A replacement for SysV init 
  - Developed by ubuntu,used i other distros

Advantages over init
   - better support for hotplug devices
   - cleaner and faster service management 
   
/etc/init
 - configuration files

initctl
 - this is the script that control the application.

After months of often bitter debate,Ubuntu will ditch and adopt systemd

Systemd

  - Improve handling of dependencies
  - Concurrent processing
  - Reduce computational overhead

/etc/systemd
 - configuration files

systemctl
 - Control Services

To switch between targets :
  #systemctl isolate muti-user.target

To get the default target :    #systemctl get-default

To set the target :   #systemctl set-default graphical.target 


Locations of systemd files         #/etc/systemd/system/


No comments:

Post a Comment