esc
during bootupinit
init
is always the first process ran by a linux system, therefor, it gets always a PID of 1
init
programs that exist
sysvinit
: Which based on sysv
, oldest and firstsystemd
: Low memory boot process, mainstream, almost used everywhere nowupstart
: Created by Ubuntu, but they switched to systemd
in the end.quiet
for kernel param is supress most boot messages
. So less verbosity for bootupudev
: Device manager for your kernel
tmpfs
)
udev
provides access, which is mounted to /dev
on startup/etc/udev/rules.d
: Folder for custom rules for the device manager udev
.
dbus
sysfs
/sys
procfs
sysfs
/proc
/proc/<PID>
+ various other stuff
/proc/cmdline
-> Kernel name from bootup/proc/version
-> Kernel version/proc/cpuinfo
-> CPU infolsmod
modprobe
udev
relies upon modprob
to load drivers for automatically detected hardwarermmod
lspci
0
- Halt or shut down system1
- Single user mode2
- Multi user mode without networking3
- Normal boot (multi user mode + networking)4
- Unused/customizable5
- Run level 3 + GUI display manager (if installed, so the graph env)6
- RebootSystemd
or sysv
)
inittab
(came with sysv
)/etc/rc0.d
… /etc/rc6.d
folders with scripts that are ran based on correlating run level. rcS.d
us ran for any run level.
systemd
run levels :
/etc/systemd/system
/usr/lib/systemd/system
/etc/systemd/system
takes precedence over /usr/lib/systemd/systen
0
- runlevel0.target, poweroff.target1
- runlevel1.target, rescue.target2,4
- runlevel2.target, runlevel4.target, multi-user.target3
- runlevel3.target, multi-user.target5
- runlevel5.target, graphical.target6
- runlevel6.target, reboot.targetemergency
- emergency.targetinit
/telinit
you can tell what level to runsystemctl
systemd
kubectl
)sudo systemctl status sound.target
sudo systemctl stop sound.target
sudo systemctl status sound.target
sudo systemctl start sound.target
sudo systemctl status sound.target
ps
: List active processesps aux | head
: Shows the top processes where you will seee /sbin/init
dmesg
: Kernel messages logged from the last bootuphead
: take first n
linestail
: take last n
linesless
: page through a long resultman
: manualsudo wall
: Send a message to anyone logged in/has open shell (like announce a reboot)which
: Where is an app running from?/
: root/usr
: user binaries installed/home
:/boot
: All related to booting/var
: Variable data (e.g. system logs …)/tmp
: Everyone on the system can write to/home
/var
/tmp
/home/nick/blah/
/home/ian/dbdata
with data in it.
/home/ian/dbdata
, the data in there will be hidden and overtaken with this mounted partition (like a volume with docker)/boot/grub/grub.cfg
results in editing your boot loader logic/etc/grub.d
and /etc/default/grub
using grub-mkconfig
grub-probe
grub-install
: To install grub to the MBR of the specified disk (in case that didn’t happen yet)
sudo vi /etc/default/grub
filesudo update-grub
/etc/ld.so.conf
lists the locations of the shared libraries on your system.include
statements means it was split into other linked filesldd
: ldd prints the shared objects (shared libraries) required by each program or shared object specified on the command line.
ldd /bin/ls
dpkg
: Debian Package Manager
apt
/etc/apt/sources.list
is the list for mirrors of apt
and specifics on which repos per mirror to use
main
: Officially supported softwarerestricted
: supported software (not free under completely free license)xenial
: current versionuniverse
: community maintained softwaremultiverse
: Not free softwareapt-get update
: update local package listsapt-get install <name>
: Install softwareapt-get remove <name>
: Uninstall software
dpkg --purge <name>
for cleanupapt-cache depends <name>
: Show what a app depends onapt-cache search <name>
: Search for packages with a particular nameapt-get upgrade
: Upgrade all current installed packages (respecting semver)apt-get dist-upgrade
: upgrade everything and remove anything unusedwget
Download a file to current location
Quiz
LD_LIBRARY_PATH