linux_wiki:init_systems

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

linux_wiki:init_systems [2015/03/10 22:04]
billdozor created
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. 
- 
----- 
- 
-===== SysV Init (init) ===== 
- 
-__Distributions__: RHEL/CentOS <= 6 (RHEL 6 uses an init/upstart combination), Debian <= 7 
- 
-==== Init run levels ==== 
-  * 0 : shutdown 
-  * 1 and S : single user mode 
-  * 2 - 5 : include networking support (GUI login can start at one of these, distro depending) 
-  * 6 : reboot level 
- 
-==== Defualt run level ==== 
-  * Set in file: /etc/inittab 
- 
-Example with run level 5 as default: 
-<code bash> 
-id:5:initdefault 
-</code> 
- 
-==== Master Copy of Startup Scripts ==== 
-/etc/init.d/ 
- 
-==== rc#.d directories ==== 
-The rc#.d directories contain symbolic links to the scripts in /etc/init.d. 
- 
-# = the run level, ie rc0.d, rc1.d, rc2.d, rc3.d, rc4.d, rc5.d, rc6.d 
- 
-__Locations__ 
-  * /etc/rc.d/rc#.d or 
-  * /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. 
-  * /etc/rc2.d/S80cups  = This would Start(S) cups after any scripts numbered S01 to S79 
-  * /etc/rc0.d/K80cups  = This would Stop/Kill (K) cups after any scripts numbered K01 to K79 
- 
-==== Manage Services ==== 
- 
-  * chkconfig: Red Hat based systems 
-  * update-rc.d: Debian/Ubuntu 
- 
-List all services and the run levels they will start on: 
-<code bash> 
-chkconfig --list 
-</code> 
- 
-List a single service: 
-<code bash> 
-chkconfig --list httpd 
-</code> 
- 
-Set a service to start on boot 
-<code bash> 
-chkconfig httpd on 
-</code> 
- 
-==== Control Services ==== 
-Show service status 
-<code bash> 
-service httpd status 
-or 
-/etc/init.d/httpd status 
-</code> 
- 
-Stop/start/restart a service 
-<code bash> 
-service httpd stop 
-service httpd start 
-service httpd restart 
-</code> 
- 
----- 
- 
-===== Upstart ===== 
- 
-__Distributions__: Ubuntu 9.10 - Current (migrating to systemd), RHEL/CentOS 6 (some scripts) 
- 
-Upstart uses event driven jobs, instead of run levels to executes scripts. 
-It does have events for rc0-6 to maintain comptability with init. 
- 
-==== Job Definition Files ==== 
- 
-  * Location: /etc/event.d/ 
- 
-==== Control Jobs ==== 
- 
-List all known jobs 
-<code bash> 
-initctl list 
-</code> 
- 
-Show status of a job 
-<code bash> 
-initctl status httpd 
-</code> 
- 
-Stop/start/restart a job 
-<code bash> 
-initctl stop httpd 
-initctl start httpd 
-initctl restart httpd 
-</code> 
- 
----- 
- 
-===== Systemd ===== 
- 
-__Distributions__: RHEL/CentOS 7, Debian 8, Ubuntu 15.4? 
- 
-==== Location of Unit Scripts ==== 
- 
-All of systemd unit scripts are located here (and sub folders): 
-<code bash> 
-/usr/lib/systemd/ 
-</code> 
- 
-Systemd uses this directory of symlinks to run those scripts: 
-<code bash> 
-/etc/systemd/system/ 
-</code> 
- 
-Other systemd configuration: 
-<code bash> 
-/etc/systemd/ 
-</code> 
- 
-==== Control Units ==== 
- 
-List all loaded units 
-<code bash> 
-systemctl list-units 
-or 
-systemctl 
-</code> 
- 
-List all loaded but inactive too 
-<code bash> 
-systemctl --all 
-</code> 
- 
-List all installed units 
-<code bash> 
-systemctl list-unit-files 
-</code> 
- 
-Show status of a unit 
-<code bash> 
-systemctl status NetworkManager.service 
-or 
-systemctl status NetworkManager 
-</code> 
- 
-Stop/start/restart a unit 
-<code bash> 
-systemctl stop NetworkManager 
-systemctl start NetworkManager 
-systemctl restart NetworkManager 
-</code> 
- 
-==== Laptop: Disable Suspend ==== 
- 
-On systemd based systems, the laptop suspend on lid closed can be disabled by changing the logind config. 
- 
-1) Edit /etc/systemd/logind.conf 
- 
-2) Uncomment "HandleLidSwitch" and set to ignore 
-<code bash> 
-HandleLidSwitch=ignore 
-</code> 
  • linux_wiki/init_systems.txt
  • Last modified: 2019/05/25 23:50
  • (external edit)