0
0
Linux CLIscripting~10 mins

Startup and init systems (systemd) in Linux CLI - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Startup and init systems (systemd)
Power On
Firmware (BIOS/UEFI)
Load bootloader (GRUB)
Start kernel
systemd starts
Read unit files
Start target units (like multi-user.target)
Start services in order
System ready for use
This flow shows how systemd starts after the kernel loads, reads unit files, and starts services to make the system ready.
Execution Sample
Linux CLI
systemctl start sshd.service
systemctl status sshd.service
systemctl enable sshd.service
Starts the SSH service, checks its status, and enables it to start on boot.
Execution Table
StepCommandActionResultOutput
1systemctl start sshd.serviceStart sshd service nowSuccess● sshd.service - OpenSSH server daemon Loaded: loaded (/usr/lib/systemd/system/sshd.service; disabled) Active: active (running) since ...
2systemctl status sshd.serviceCheck sshd service statusActive● sshd.service - OpenSSH server daemon Active: active (running) since ...
3systemctl enable sshd.serviceEnable sshd to start at bootSuccessCreated symlink /etc/systemd/system/multi-user.target.wants/sshd.service → /usr/lib/systemd/system/sshd.service
4systemctl is-enabled sshd.serviceVerify enable statusenabledenabled
5systemctl stop sshd.serviceStop sshd serviceSuccess
6systemctl status sshd.serviceCheck sshd service statusInactive● sshd.service - OpenSSH server daemon Active: inactive (dead) since ...
💡 Commands complete; sshd service started, enabled, then stopped and status checked.
Variable Tracker
VariableStartAfter Step 1After Step 2After Step 3After Step 5Final
sshd.service statusinactiveactive (running)active (running)active (running)inactive (dead)inactive (dead)
sshd.service enableddisableddisableddisabledenabledenabledenabled
Key Moments - 3 Insights
Why does 'systemctl start' not enable the service to start on boot?
'systemctl start' only starts the service now but does not change boot settings. Enabling requires 'systemctl enable' as shown in step 3.
What does 'enabled' mean in systemd context?
'Enabled' means systemd will start the service automatically at boot. This is confirmed in step 4 with 'systemctl is-enabled'.
Why is the service status 'inactive' after stopping it?
Stopping the service with 'systemctl stop' (step 5) halts it immediately, so status changes to 'inactive' as seen in step 6.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the status of sshd.service after step 1?
Afailed
Binactive (dead)
Cactive (running)
Denabled
💡 Hint
Check the 'Result' and 'Output' columns in row for step 1.
At which step is sshd.service enabled to start at boot?
AStep 3
BStep 1
CStep 5
DStep 6
💡 Hint
Look for the command 'systemctl enable sshd.service' in the execution table.
If you skip 'systemctl enable', what happens on next boot?
Asshd.service starts automatically
Bsshd.service does not start automatically
Csshd.service fails to start
Dsshd.service is removed
💡 Hint
Refer to the meaning of 'enabled' in the key moments section.
Concept Snapshot
systemd manages startup by reading unit files and starting services.
Use 'systemctl start <service>' to run now.
Use 'systemctl enable <service>' to start on boot.
Check status with 'systemctl status <service>'.
Stopping a service changes status to inactive.
Full Transcript
When a Linux system boots, systemd starts after the kernel loads. It reads unit files that describe services and targets. Using systemctl commands, you can start services immediately, check their status, and enable them to start automatically on boot. For example, 'systemctl start sshd.service' runs the SSH server now, but does not enable it. 'systemctl enable sshd.service' sets it to start on future boots. Stopping a service with 'systemctl stop' makes it inactive. This flow helps manage system services clearly and reliably.