Differences
This shows you the differences between two versions of the page.
linux_wiki:init_systems [2015/03/10 23:41] billdozor [All Inits Run Levels] |
linux_wiki:init_systems [2019/05/25 23:50] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Init Systems ====== | ||
- | **General Information** | ||
- | |||
- | Down and dirty quick info about three different init systems that Linux uses; SysV init, upstart, and systemd. | ||
- | |||
- | **Checklist** | ||
- | * Distro: Varies, depending upon init system. | ||
- | |||
- | ---- | ||
- | |||
- | ===== All Inits ===== | ||
- | |||
- | This section will compare three init systems; sysv, upstart, and systemd. | ||
- | |||
- | ==== Command Table ==== | ||
- | |||
- | * The service name " | ||
- | * systemctl assumes " | ||
- | |||
- | ^ Command ^ Sysv ^ Upstart ^ Systemd ^ | ||
- | | Status of Service | service foo status | initctl status foo | systemctl status foo | | ||
- | | Start Service | service foo start | initctl start foo | systemctl start foo | | ||
- | | Stop Service | service foo stop | initctl stop foo | systemctl stop foo | | ||
- | | Restart Service | service foo restart | initctl restart foo | systemctl restart foo | | ||
- | | Reload config file | service foo reload | initctl reload foo | systemctl reload foo | | ||
- | | List services | ls / | ||
- | | Enable Service At Boot | chkconfig foo on | Edit / | ||
- | | Disable Service At Boot | chkconfig foo off | Edit / | ||
- | | List services and enabled run levels | chkconfig --list | initctl show-config | systemctl list-unit-files --type=service (or)\\ ls / | ||
- | |||
- | ---- | ||
- | |||
- | ==== All Inits Run Levels ==== | ||
- | |||
- | ^ Description ^ Sysv ^ Upstart ^ Systemd ^ | ||
- | | Halt system | 0 | runlevel [0] | poweroff.target | | ||
- | | Single user mode | 1,s,single | runlevel [1] | rescue.target | | ||
- | | User defined. Same as 3 by default. | 2,4 | runlevel [24] | multi-user.target | | ||
- | | Multi-user, non-graphical | 3 | runlevel [3] | multi-user.target | | ||
- | | Multi-user, graphical | 5 | runlevel [5] | graphical.target | | ||
- | | Reboot | 6 | runlevel [6] | reboot.target | | ||
- | | Emergency shell | emergency | ? | emergency.target | | ||
- | |||
- | * Note: Upstart has many different " | ||
- | |||
- | ---- | ||
- | |||
- | ===== SysV Init (init) ===== | ||
- | |||
- | Sysv init details not contained in All Inits section. | ||
- | |||
- | __Distributions__: | ||
- | |||
- | ==== Defualt run level ==== | ||
- | * Set in file: / | ||
- | |||
- | Example with run level 5 as default: | ||
- | <code bash> | ||
- | id: | ||
- | </ | ||
- | |||
- | ==== Master Copy of Startup Scripts ==== | ||
- | / | ||
- | |||
- | ==== rc#.d directories ==== | ||
- | The rc#.d directories contain symbolic links to the scripts in / | ||
- | |||
- | # = the run level, ie rc0.d, rc1.d, rc2.d, rc3.d, rc4.d, rc5.d, rc6.d | ||
- | |||
- | __Locations__ | ||
- | * / | ||
- | * /etc/rc#.d | ||
- | |||
- | __Script Names__ | ||
- | * Scripts are named for if they are going to Start(S) or Kill(K) the script, a sequence number, and then the name of the script. | ||
- | * / | ||
- | * / | ||
- | |||
- | ==== Manage Services ==== | ||
- | |||
- | * service command: RedHat and Debian (service status/ | ||
- | * chkconfig: Red Hat based systems (enable/ | ||
- | * update-rc.d: | ||
- | |||
- | ---- | ||
- | |||
- | ===== Upstart ===== | ||
- | |||
- | Upstart details not contained in All Inits section. | ||
- | |||
- | __Distributions__: | ||
- | |||
- | Upstart uses event driven jobs, instead of run levels to executes scripts. | ||
- | It does have events for rc0-6 to maintain compatibility with init. | ||
- | |||
- | * Job Definition Files Location: /etc/init/ | ||
- | * Job control: initctl | ||
- | |||
- | ---- | ||
- | |||
- | ===== Systemd ===== | ||
- | |||
- | Systemd details not contained in All Inits section. | ||
- | |||
- | __Distributions__: | ||
- | |||
- | ==== Location of Unit Scripts ==== | ||
- | |||
- | All of systemd unit scripts are located here (and sub folders): | ||
- | <code bash> | ||
- | / | ||
- | </ | ||
- | |||
- | Systemd uses this directory of symlinks to run those scripts: | ||
- | <code bash> | ||
- | / | ||
- | </ | ||
- | |||
- | Other systemd configuration: | ||
- | <code bash> | ||
- | / | ||
- | </ | ||
- | |||
- | ==== Laptop: Disable Suspend ==== | ||
- | |||
- | On systemd based systems, the laptop suspend on lid closed can be disabled by changing the logind config. | ||
- | |||
- | 1) Edit / | ||
- | |||
- | 2) Uncomment " | ||
- | <code bash> | ||
- | HandleLidSwitch=ignore | ||
- | </ |