Course textbook 1, chapter 9.
Course textbook 2, pages 63-70.
lsinitrd- wrapper around initial ramdisk image (looks for magic strings inside the image file to seperate the first cpio archive from the second part of the image).
systemd
systemctlcommands referencing object or units that do not specify the ‘.type’ suffix, are assumed to service objects, and are automatically suffixed with.service.- Targets are analagous to old
init“runlevels”.telinitis analagous tosystemctl isolate foo-unit.target- Useful targets are:
multi-user.target,rescue.targetandemergency.target(similar torescue.target, but gives you the shell after the root filesystem pivot has happened).
- Kernel argument
systemd.unit=mytarget.targetsets the systemd target.systemctl get-defaultandsystemctl set-default <TARGET>can be used to change the default target.
systemctl enable debug-shell.service- Provides a password-less root shell on VTY9 (Ctrl-Alt-F9) to debug the systemd boot process at boot time.
systelctl list-jobs
- Additional useful arguments are:
is-enabled,is-active,list-units,list-unit-files(enabled, loaded or not),--output=json,--no-legend,--no-pager,show(machine readable version ofstatus).
Grub2 & Dracut
- Kernel argument
rd.breakis analagous to the oldSorsinglekernel argument for single usermode, in that it will dump you to a shell inside the initial ramdisk image (Dracut) environment.mount -o remount,rw /sysroot- Target root filesystem is mounted read-only on/sysrootbefore pivot.
- Kernel argument
selinux=0andenforcing=0will overload/etc/sysconfig/selinuxvalues at boot. touch /.autorelabelwill force default SELinux labels to be restored to core files at boot (necessary if you clobber SELinux labels by changing the root password from inside Dracut for example, as Dracut runs without SELinux).
journald
To persist journald log databases between reboots:
mkdir /var/log/journal \
&& chown root:system-journal /var/log/journal \
&& chmod 2755 /var/log/journal \
&& systemctl restart systemd-journal.servicefirewalld
firewald.service- systemd object / unit service name.firewall-configfirewall-cmd- Remember to use the
--permanentargument to persist the configuration change to disk, and then usefirewall-cmd reloadto apply it, otherwise the change will be made to the current running configuration only.
- Remember to use the
firewall-offline-cmd/lib/firewalld/(and by extension due to the/usr/symlink,/usr/lib/firewalld/)/etc/firewalld/