Common First Tasks
Part of Day One
This is the seventh article in the Day One: Getting Started series. You should have already completed Getting Access, Orientation, Understanding Your Permissions, Safe Exploration, Reading Logs, and Finding Documentation.
Your team lead sends you a message: "Can you check if the API service is running?"
Or: "The logs should show what's wrong."
Or: "Just verify the config looks correct."
These are the tasks you'll actually be asked to do on your first day with a new server. Let's walk through them.
Checking If a Service Is Running
The ask: "Is nginx running?" / "Can you check if the app is up?"
Using systemctl (Modern Linux)
What to look for:
● nginx.service - A high performance web server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
Active: active (running) since Mon 2024-01-15 10:00:00 UTC; 5 days ago
Main PID: 1234 (nginx)
Active: active (running)— It's running ✅Active: inactive (dead)— It's stopped ❌Active: failed— It crashed ❌
Check Multiple Services
systemctl status nginx
systemctl status mysql
systemctl status redis
systemctl status docker
Is It Listening on the Expected Port?
A service can be "running" but not actually accepting connections:
What you want to see:
If nothing shows up, the service isn't listening.
Tailing Application Logs
The ask: "Check the logs and see what's happening"
Log reading is covered in depth in Reading Logs Like a Pro. Here are the quick commands for checking logs as part of a task:
Reproduce the problem and watch for new entries. Press Ctrl+C to stop.
For time-windowed searches, common log formats, and error pattern analysis, see Reading Logs Like a Pro.
Finding Configuration Files
The ask: "Can you check the config for [setting]?"
Common Config Locations
| Application | Config Location |
|---|---|
| Nginx | /etc/nginx/nginx.conf, /etc/nginx/sites-enabled/ |
| Apache | /etc/apache2/apache2.conf, /etc/apache2/sites-enabled/ |
| MySQL | /etc/mysql/my.cnf |
| PostgreSQL | /etc/postgresql/*/main/postgresql.conf |
| SSH | /etc/ssh/sshd_config |
| System | /etc/ (most things) |
| Applications | /opt/app-name/config/, /var/www/app/config/ |
Read a Config File
Search for a Specific Setting
grep -r "worker_processes" /etc/nginx/
grep -r "database" /var/www/app/config/
Check Config Syntax (Before Changes)
Many services can validate their config:
nginx -t
# nginx: configuration file /etc/nginx/nginx.conf syntax is ok
# nginx: configuration file /etc/nginx/nginx.conf test is successful
apache2ctl configtest
mysql --help --verbose | grep "Default options"
Checking What's Using Resources
The ask: "The server is slow, can you see what's happening?"
CPU and Memory Overview
Quick reads:
- Look at the top processes — are any using 100% CPU?
- Check memory (Mem line) — is it nearly full?
- Check load average — above 1.0 per core means busy
Press q to exit.
Find the Hungry Processes
Check Disk Space
Red flag: Any filesystem at 90%+ usage.
What's Using All the Disk?
Then drill down:
Checking Database Connectivity
The ask: "Is the app connecting to the database?"
Test MySQL/MariaDB Connection
If it connects, the database is accessible.
Test PostgreSQL Connection
Check from Application Perspective
Look in the app logs for database errors:
Common errors:
- "Connection refused" — Database isn't running or wrong port
- "Access denied" — Wrong credentials
- "Too many connections" — Database overwhelmed
Checking External Connectivity
The ask: "Can the server reach [external service]?"
Basic Connectivity Test
Test HTTP Endpoints
What to look for:
HTTP/1.1 200 OK— It's workingConnection refused— Service is down or blockedConnection timed out— Network issue or firewall
Check DNS Resolution
Test Specific Port
nc -zv api.example.com 443
# Connection to api.example.com 443 port [tcp/https] succeeded!
Checking Recent Deployments
The ask: "When was the last deploy? What changed?"
Check Git History
Check File Modification Times
Check Deployment Logs
Verifying a Fix Worked
The ask: "Can you verify the fix worked?"
Check Service Status
Check Logs for Errors
Wait a minute, trigger some traffic, see if errors appear.
Test the Endpoint
curl -s http://localhost/health | head -20
curl -I https://app.example.com/api/status
Monitor for a Few Minutes
Watch for a few minutes. No errors? The fix probably worked.
Task Quick Reference
| Task | Command |
|---|---|
| Check if service running | systemctl status servicename |
| Check listening ports | ss -tlnp or netstat -tlnp |
| Follow logs | tail -f /var/log/app/error.log |
| Find errors in logs | grep -i error /var/log/app/*.log |
| Check config file | cat /etc/nginx/nginx.conf |
| Find config setting | grep -r "setting" /etc/nginx/ |
| Check CPU/memory | top or htop |
| Check disk space | df -h |
| Find large files | du -sh /* \| sort -hr \| head |
| Test connectivity | ping, curl, nc -zv |
| Recent deployments | git log --oneline -10 |
Practice Exercises
Exercise 1: Check Whether a Service Is Healthy
Your team lead asks: "Is nginx running and actually accepting connections?" Check the service status AND verify it's listening on port 80.
Hint: You need two commands — systemctl and ss.
Solution
You want to see Active: active (running) from the first command, and a LISTEN entry on port 80 from the second. If the service is running but not listening, something is wrong with its configuration.
Exercise 2: Find What's Eating Disk Space
df -h shows that /var is at 91% usage. Find the top 10 largest directories inside /var.
Hint: Use du with appropriate flags, then sort.
Solution
/var/log is the usual culprit on busy servers. From there, drill deeper:
Exercise 3: Verify a Fix Worked
After a colleague restarts a service, you're asked to confirm it's working. What's your verification process for nginx?
Hint: Three steps — service status, port listening, no new errors in logs.
Solution
# 1. Service is running
systemctl status nginx
# 2. Listening on expected ports
ss -tlnp | grep nginx
# 3. No new errors in last 50 lines
tail -50 /var/log/nginx/error.log
Watch the logs for 30–60 seconds after the restart. A clean log with no new errors is a good sign.
Quick Recap
Service checks:
systemctl status— Is it running?ss -tlnp— Is it listening?tail -flogs — Any errors?
Resource checks:
top— CPU/memory overviewdf -h— Disk spacedu -sh— What's using space
Connectivity checks:
ping— Basic reachabilitycurl— HTTP endpointsnc -zv— Port connectivity
Further Reading
Command References
man systemctl— Full systemctl documentation including all unit states and sub-commandsman ss— Socket statistics; replaces the deprecatednetstaton modern systemsman top— Interactive process viewer; presshinsidetopfor a keyboard shortcut referenceman df— Disk free space;-ishows inode usage (a different way a filesystem can "fill up")man du— Disk usage;--max-depthcontrols how many levels deep to reportman curl— HTTP client with extensive options for testing endpoints and APIs
Official Documentation
- systemd documentation — Comprehensive systemd and systemctl reference
- Red Hat: Managing Services with systemd — Practical systemd service management guide
Related Articles
- Reading Logs — In-depth guide to log analysis; covers everything in the Tailing Logs section above and much more
- Safe Exploration — Reminder of which commands are safe to run on production without permission
What's Next?
You've learned what to do. Now let's cover what NOT to do. Head to The "Don't Do This" Guide for production safety rules that will keep you out of trouble.
Write Down Your Findings
When someone asks you to check something, report back with specifics:
"Nginx is running (PID 1234, up for 5 days). It's listening on port 80 and 443. The last error in the logs was 2 hours ago and looks like a client timeout, not a server issue."
Much better than "Yeah, it's fine."