Learn 🧠 All Concepts (20) 🤖 What is an LLM? 📚 RAG Explained ⚡ AI Agents 💻 Run AI Locally 🇮🇳 AI in India 📖 Learn Tracks 🔧 DevOps Track ⚙️ AI Ops Track 🗺️ AI Engineer Roadmap
Tools 🔧 AI Tools Directory 🔓 Open Source AI ⭐ Top GitHub Repos ✦ Claude Skill Repos 🚀 Ready-to-Deploy Projects
Build 🏗️ Build Hub 🎯 Master Prompts 🧩 RAG Agents 🚀 App Megaprompts
Workflows ⚡ All Workflows (22) 🎥 Text to Video 🎞️ Image to Video 🔊 Text to Speech ♻️ Automation
Resources 🧪 Colab Notebooks ⚙️ n8n Workflows 📈 Algo Trading 💰 Passive Income
🗂️ Browse All Topics About AItheGuru
Learn Linux for Production Support Vijay manages services without Services.msc
Linux for Production Support Ch 3 / 32 Intermediate 🪟 Windows → Linux
⚙️

Vijay manages services without Services.msc

systemctl, journalctl — better than Services.msc once you know how

⏱ 12 min 6 commands 5 takeaways
⚙️
In this chapter
Vijay
Windows support engineer, week 2 on Linux
The story

In week 2, Vijay needed to restart a service, check why it crashed, and set it to auto-start. On Windows he would open Services.msc. On Linux he had to learn systemctl.

After one week with systemctl, he admitted it was faster than the GUI.

SYSTEMCTL IS YOUR NEW SERVICES.MSC

Windows Services.msc action    Linux systemctl equivalent
Start service                   systemctl start servicename
Stop service                    systemctl stop servicename
Restart service                 systemctl restart servicename
Set to Automatic startup        systemctl enable servicename
Set to Disabled startup         systemctl disable servicename
Check status                    systemctl status servicename
View all services               systemctl list-units --type=service
View failed services            systemctl list-units --failed
sudo systemctl status nginx        # Is nginx running?
sudo systemctl start nginx         # Start it
sudo systemctl stop nginx          # Stop it
sudo systemctl restart nginx       # Restart it
sudo systemctl enable nginx        # Auto-start on boot (Automatic in Services.msc)
sudo systemctl disable nginx       # Do not auto-start on boot
sudo systemctl is-active nginx     # Quick check: prints active or inactive

The systemctl status output gives you more than Services.msc:

systemctl status nginx
# nginx.service - A high performance web server
#    Loaded: loaded (/lib/systemd/system/nginx.conf; enabled)
#    Active: active (running) since Mon 2026-03-16 14:23:00 UTC; 2 days ago
#  Main PID: 5678 (nginx)
# Mar 16 14:23:00 server01 nginx[5678]: nginx started successfully

PID, uptime, recent log lines, and whether it auto-starts — all in one command.

JOURNALCTL IS YOUR NEW EVENT VIEWER

journalctl                              # all logs (q to quit)
journalctl -n 50                        # last 50 log lines
journalctl -f                           # live view (like refreshing Event Viewer)
journalctl -u nginx                     # logs for nginx only (filter by Source)
journalctl -u nginx -f                  # follow nginx logs live
journalctl -p err                       # only errors (filter by Level=Error)
journalctl --since "1 hour ago"         # last hour (filter by time)
journalctl --since "2026-03-16 14:00" --until "2026-03-16 15:00"   # time range
journalctl -u nginx --since today       # today only

SERVICE CRASHED - HOW TO FIND OUT WHY

On Windows: Event Viewer > Windows Logs > Application, filter by source, filter by Error level.

On Linux:

systemctl status myapp                  # shows recent log lines and exit code
journalctl -u myapp --since "30 minutes ago"
journalctl -u myapp -p err             # only errors

WRITING YOUR OWN SERVICE (like creating a Windows Service)

sudo nano /etc/systemd/system/myapp.service
[Unit]
Description=My Python Application
After=network.target
[Service]
Type=simple
User=appuser
WorkingDirectory=/opt/myapp
ExecStart=/usr/bin/python3 /opt/myapp/app.py
Restart=always
RestartSec=5
Environment=APP_ENV=production
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload        # refresh after adding service file
sudo systemctl enable myapp         # set to auto-start
sudo systemctl start myapp          # start it now

ENVIRONMENT VARIABLES (no Registry needed)

export MY_VAR=value                 # set for current session
echo $MY_VAR                        # read it
printenv                            # see all variables (like Windows set command)
printenv | grep -i database         # filter variables
# System-wide variables:
sudo nano /etc/environment          # like System Properties > Environment Variables

Vijay managed his first Linux service crisis on day 9 in 7 minutes without opening a single GUI.

Key takeaways

systemctl start/stop/restart/status servicename replaces Services.msc right-click menu

systemctl enable sets a service to auto-start on boot — equivalent to Automatic startup type

journalctl -u servicename replaces Event Viewer filtered by Source — much faster to query

journalctl --since '1 hour ago' -p err gets recent errors for any service instantly

Service definition files in /etc/systemd/system/ replace Windows service registry entries

Commands from this chapter
$ systemctl status servicename
Services.msc status — shows PID, uptime, recent logs
$ systemctl restart servicename
Right-click Restart in Services.msc
$ systemctl enable servicename
Set to Automatic startup — survives reboots
$ journalctl -u servicename -n 100
Event Viewer filtered by source — last 100 lines
$ journalctl -u servicename -f
Live Event Viewer — watch logs as they appear
$ journalctl --since '1 hour ago' -p err
All errors from the last hour across all services