LPIC 101-3 Change runlevels/boot targets and shutdown or reboot system

Содержание:

shutdown — base power management command;

/etc/init.d/ — folder with daemons management scripts;

service — command to manage daemons;

init — runlevel management utility (works in some distros);

telinit — runlevel management utility (works everywhere);

wall — send broadcast message to all users;

SysV

runlevel (modes: 0 — halt; 1 — single-user; 2 — default for Debian/Ubuntu; 3 — default RedHat/Suse text; 4 — wildcard mode, programmable; 5 — RedHat/Suse GUI mode; 6 — reboot) — shows current runlevel;

/etc/inittab — conf file for sysv;

/etc/rc{n}.d — runlevel scripts (K{m} — kill script, S{l} — start script, where {l} & {m} — order and {n} — runlevel);

SystemD

unit — systemd modules(.service, .mount, .device, .socket, .target);

/etc/systemd/ — admin systemd units;

/usr/lib/systemd/ — system and user systemd units;

target — systemd group units, there is runlevel analog targets too (list-units --type=target; systemctl isolate name.target, systemctl set-default -f name.target);

systemctl — main systemd control utility (list-units, --failed, list-units --type=service, status cron.service);

systemctl reboot | poweroff | suspend | hibernate | hybrid-sleep

systemctl start | stop | reload | restart | status unit

journalctl — system journal daemon (journald) control utility.

Upstart

services and tasks — base units of upstart;

/etc/init — folder with tasks;

/etc/init/rc-sysinit.conf — main config for upstart (contains default runlevel settings);

initctl — upstart control utility (initctl show-config, initctl check-config);

Runlevel utility works everywhere for backward compatibility.