Day 26/100: Bringing Applications to Life – Linux Service Management ⚙️ Today’s Focus: Yesterday, I learned how to download and install packages like the Apache Web Server (httpd). But installing software is only half the battle—today, I learned how to manage and control those background applications using systemd and the systemctl command! 🛠️ Taking Control with Systemctl: In Linux, background applications are called services (or daemons). I spent today practicing how to manage the lifecycle of the Apache service: systemctl status httpd: The diagnostic tool. I used this to check if my web server was currently running ("active") or turned off ("inactive/dead"). systemctl start httpd: The command to actually ignite the application and get it running in the background. systemctl stop httpd: To gracefully shut the service down. systemctl restart httpd: Essential for applying new configuration changes without bringing the whole server offline. 🔄 Surviving a Reboot: I also learned a crucial DevOps lesson today: just because you start a service doesn't mean it will stay running if the server crashes or reboots! To ensure my web server automatically turns back on after a system reboot, I have to explicitly tell the system to do so using: systemctl enable httpd Why It Matters: Whether it is a web server, a database, or a custom application, a DevOps engineer's job is to ensure high availability. Mastering systemctl is how we ensure critical services stay alive and properly configured! #100DaysOfDevOps #100DaysOfCode #Linux #SystemAdmin #CentOS #Vagrant #Systemctl #DevOpsEngineer #TechJourney #DailyProgress #CloudComputing
Linux Service Management with Systemctl
More Relevant Posts
-
🚀 Understanding Linux Services (systemd) — The Backbone of Reliable Systems Ever wondered how your applications keep running even after a server reboot? That’s where Linux services come into play. 💡 What is a Linux Service? A Linux service is a background process (daemon) managed by the system to ensure critical software runs continuously without manual intervention. These services are orchestrated by systemd, the init system used in most modern Linux distributions. ⚙️ Why Linux Services Matter ✅ Auto-start on boot Services automatically start when the server boots — no manual effort needed. ✅ Always running in the background Web servers, databases, and containers run silently while you focus on building features. ✅ Dependency & startup order management Ensures correct sequence: Database starts first Then backend Then web server ✅ Self-healing capabilities Services can be configured to restart automatically if they fail. 🔍 Real-world Examples Web Server (Nginx / Apache) Database Server (MySQL / PostgreSQL) Docker Engine Custom backend applications 🧰 Essential systemctl Commands # Start a service sudo systemctl start app # Stop a service sudo systemctl stop app # Restart a service sudo systemctl restart app # Enable service at boot sudo systemctl enable app # Disable service sudo systemctl disable app # Check status systemctl status app # View logs journalctl -u app 🛠️ How to Create Your Own Linux Service Create a file: sudo vi /etc/systemd/system/app.service Example: [Unit] Description=My Custom App Service After=network.target [Service] User=ubuntu WorkingDirectory=/home/ubuntu/myapp ExecStart=/usr/bin/python3 app.py Restart=always [Install] WantedBy=multi-user.target 🔄 Apply & Run the Service sudo systemctl daemon-reexec sudo systemctl daemon-reload sudo systemctl enable app.service sudo systemctl start app.service 🎯 Takeaway Linux services are the unsung heroes of production systems – ensuring your applications: ✔ Start automatically ✔ Run reliably ✔ Recover from failures ✔ Follow the right startup sequence #Linux #DevOps #SystemDesign #SRE #CloudComputing #Infrastructure #systemd #Automation
To view or add a comment, sign in
-
-
🚀 Understanding Linux Services (systemd) — The Backbone of Reliable Systems Ever wondered how your applications keep running even after a server reboot? That’s where Linux services come into play. 💡 What is a Linux Service? A Linux service is a background process (daemon) managed by the system to ensure critical software runs continuously without manual intervention. These services are orchestrated by systemd, the init system used in most modern Linux distributions. ⚙️ Why Linux Services Matter ✅ Auto-start on boot Services automatically start when the server boots — no manual effort needed. ✅ Always running in the background Web servers, databases, and containers run silently while you focus on building features. ✅ Dependency & startup order management Ensures correct sequence: Database starts first Then backend Then web server ✅ Self-healing capabilities Services can be configured to restart automatically if they fail. 🔍 Real-world Examples Web Server (Nginx / Apache) Database Server (MySQL / PostgreSQL) Docker Engine Custom backend applications 🧰 Essential systemctl Commands # Start a service sudo systemctl start app # Stop a service sudo systemctl stop app # Restart a service sudo systemctl restart app # Enable service at boot sudo systemctl enable app # Disable service sudo systemctl disable app # Check status systemctl status app # View logs journalctl -u app 🛠️ How to Create Your Own Linux Service Create a file: sudo vi /etc/systemd/system/app.service Example: [Unit] Description=My Custom App Service After=network.target [Service] User=ubuntu WorkingDirectory=/home/ubuntu/myapp ExecStart=/usr/bin/python3 app.py Restart=always [Install] WantedBy=multi-user.target 🔄 Apply & Run the Service sudo systemctl daemon-reexec sudo systemctl daemon-reload sudo systemctl enable app.service sudo systemctl start app.service 🎯 Takeaway Linux services are the unsung heroes of production systems – ensuring your applications: ✔ Start automatically ✔ Run reliably ✔ Recover from failures ✔ Follow the right startup sequence #Linux #DevOps #SystemDesign #SRE #CloudComputing #Infrastructure #systemd #Automation
To view or add a comment, sign in
-
-
Most Linux systems I come across still default to Bash—and for good reason. It’s stable, predictable, and has been doing the job for decades. But the moment you start working across multiple users or environments, a few limitations become hard to ignore: ⚠️ Minimal auto-suggestions ⚠️ Basic tab completion ⚠️ No built-in plugin ecosystem ⚠️ Prompt customization that quickly turns messy and inconsistent It works—but it doesn’t scale well in terms of user experience or maintainability. That’s usually where ZSH (Z-SHELL) comes in. Better completion, inline suggestions, extensibility—it’s a clear upgrade for anyone spending serious time in the terminal. But switching to ZSH alone doesn’t solve the real problem. You still end up with: ⚠️ Different .zshrc files across users ⚠️ Plugin sprawl ⚠️ Inconsistent prompts ⚠️ No rollback if something breaks In other words, you’ve improved the shell… but not the system around it. Then comes the prompt layer. A lot of people use frameworks, but they tend to be heavy and slow things down. That’s where Starship fits in: ⚡ Fast (written in Rust) ⚡ Consistent across environments ⚡ Clean, informative prompt without overhead Now you have a powerful shell and a modern prompt—but again, only if deployed correctly. This is exactly the gap I explored in my recent write-up: 🔗 https://lnkd.in/gZuy7em3 The focus isn’t just on installing ZSH or adding Starship. It’s about approaching shell environments the same way we approach systems: 🧩 Standardized 🔁 Repeatable 🔄 Reversible Because once you’re managing multiple users, the problem is no longer which shell to use—it’s how to manage it properly. For those interested, the implementation is here: 🔗 https://lnkd.in/g9ANMBpw Curious how others are handling shell standardization across environments—especially when consistency and rollback actually matter. #linux #DevOps #SysAdmin #Developer
To view or add a comment, sign in
-
-
Your Linux server is running… but your application is stuck. 🔹 Process Management (Fix Stuck Apps Like a Pro) If you can’t control processes, you can’t control your server. 🧠 What is a Process? 👉 Any running program in Linux = Process Examples: Nginx server Java application Background jobs 🔹 Must-Know Commands ps -ef top kill -9 <PID> 👉 ps -ef → list all processes 👉 top → real-time monitoring 👉 kill → stop a process 🔹 Find & Kill a Process (Step-by-Step) ps -ef | grep nginx 👉 Find process ID (PID) kill -9 1234 👉 Force stop the process 🔥 Real DevOps Troubleshooting ⚠️ Scenario 1: Application Hung (Not Responding) 👉 Website is loading forever Root cause: Process stuck in loop / high CPU ✅ Fix: top kill -9 <PID> ⚠️ Scenario 2: Port Already in Use Error: Address already in use 👉 Root cause: Old process still running ✅ Fix: netstat -tulnp | grep 8080 kill -9 <PID> ⚠️ Scenario 3: High CPU Usage 🔥 👉 Server slow, alerts triggered Root cause: One process consuming resources ✅ Fix: top 👉 Identify → Kill or optimize process ⚠️ Scenario 4: Background Job Still Running 👉 You closed terminal, but job continues Check: ps -ef | grep job Kill if needed: kill -9 <PID> ⚠️ Scenario 5: Wrong Kill Command 😬 kill -9 1 💥 This kills init/system process → system crash 👉 Always verify PID before killing 🔹 Pro Tips Use kill -15 (graceful stop) before kill -9 Don’t kill blindly—understand the process first Use top during incidents (real-time view) 🔹 Why This Matters in DevOps Fix outages fast Manage production systems Control CPU & memory usage 👉 Process control = production stability #AWS #LINUX #LINUXLEARNING #CLOUD
To view or add a comment, sign in
-
-
🚀 From “It’s not working” → to “I can debug it” I recently completed a DNS + Apache Web Server setup on RHEL. But honestly, the biggest learning wasn’t the setup — it was the troubleshooting mindset I built along the way. 🔧 What I worked on: • Configured DNS using BIND (forward & reverse zones) • Hosted a website using Apache • Tested across Windows and Ubuntu clients 🧠 What actually mattered: Instead of just following steps, I started asking: 👉 Why is it not resolving? 👉 Why is Apache showing the default page? 👉 Where exactly is the failure happening? That’s where real learning started. ⚙️ Commands that helped me debug: • systemctl status httpd → Check service status • journalctl -xe → Analyze system errors • ss -tuln | grep :80 → Verify port binding • dig domain.com → Test DNS resolution • firewall-cmd --list-all → Check firewall rules 💡 My troubleshooting flow now: 1️⃣ Check service status 2️⃣ Check logs for errors 3️⃣ Verify port listening 4️⃣ Validate DNS resolution 5️⃣ Check firewall rules Simple steps — but extremely effective in real environments. 📌 Key realization: Linux is not about memorizing commands. It’s about understanding how systems interact. Most real-world issues come down to: → Logs → Networking fundamentals → Service behavior 🌐 GitHub Project: https://lnkd.in/gTpsMqtM If you're learning Linux / DevOps: 👉 Don’t just build projects 👉 Break them, debug them, fix them That’s where real learning happens. #Linux #DevOps #SystemAdministration #DNS #Apache #Troubleshooting #RHCSA #CloudComputing
To view or add a comment, sign in
-
🚨 Application working but users still facing issues? Check logs like a pro Sometimes everything looks fine from your side… Service is running ✅ Server is up ✅ But users still report issues 😓 This is where logs become your best friend. --- 🔍 1. Start with application logs 👉 Check inside `/var/log` or app-specific folder 👉 Example: `tail -f /var/log/nginx/error.log` --- 📄 2. Look for keywords 👉 error 👉 failed 👉 timeout 👉 denied --- 🧠 3. Check timestamps 👉 Match logs with issue time 👉 Helps find exact event --- ⚡ 4. Check service logs `journalctl -u nginx` 👉 System-level logs for services --- 🌐 5. Correlate with user issue 👉 What user did? 👉 What happened in logs at same time? --- 🔁 6. Reproduce issue 👉 Try same steps 👉 Watch logs in real-time --- 🧠 Real mindset: Don’t guess ❌ Logs never lie ✅ --- #Linux #LinuxAdmin #DevOps #Troubleshooting #CloudComputing #SystemAdministration #LearningInPublic #ITInfrastructure
To view or add a comment, sign in
-
Day 24/100: Mastering Privilege Escalation with Sudo 🛡️ Today’s Focus: In Linux, the root user is practically a god—it can delete the entire file system with a single command! Because of this massive risk, best practices dictate that we should never log in directly as root. Today, I learned how to safely manage system administration using the sudo (Superuser DO) command. 🔑 What is Sudo? sudo is a program that allows a standard, everyday user to execute specific commands with administrative (root) privileges, without ever needing to know the actual root password. 🛠️ The Commands & Concepts I Explored: sudo [command]: The standard way to run a single administrative task. For example, sudo apt update. It prompts for my user password, runs the command as root, and then immediately drops me back to normal privileges. sudo -i: When I have a dozen administrative tasks to do and don't want to type "sudo" before every single line, this command acts as a shortcut. It temporarily elevates my session and drops me directly into a root shell environment. The Sudoers File (/etc/sudoers): I learned that this magic doesn't happen by default. A user must be explicitly authorized in the sudoers file (usually edited safely using the visudo command) or belong to the wheel (CentOS) or sudo (Ubuntu) group. Why It Matters: In a production DevOps environment, accountability is everything. When you use sudo, the system logs exactly who ran the command and when. It enforces the Principle of Least Privilege, keeping our infrastructure secure while still allowing engineers to get their work done! #100DaysOfDevOps #100DaysOfCode #Linux #Security #Sudo #SysAdmin #DevOpsEngineer #CentOS #Vagrant #CLI #TechJourney #DailyProgress #CloudComputing
To view or add a comment, sign in
-
One of the most common situations in production: The app is up… but suddenly it can’t connect to the database. You check the service → it’s failed You restart it → still nothing You try a few quick fixes → no result At this point, it’s tempting to start guessing. But instead, you pause… and check the logs. And that’s usually where everything becomes clear. Most of the time, the issue isn’t complicated, we just skip the basic steps. I wrote a short article about the troubleshooting approach I use to stay structured and avoid guessing in situations like this. In Linux, the answer is almost always in the logs. #DevOps #Linux #Troubleshooting #SRE
To view or add a comment, sign in
-
The Architect’s Toolkit! 🏗️ Mastering Package Management in Linux! 🐧 Building a server is like constructing a building—you need the right tools and materials at the right time. As I reach Day 6 of my System Administration journey, I’ve moved from monitoring systems to actually shaping them through Package Management. In the early days of Linux, installing software was a nightmare of manual compilations. Today, we have powerful Package Managers that handle dependencies, security updates, and installations with a single command. Mastering this is what turns a user into an Architect of Infrastructure. Deep Dive into Today’s Learning: The APT Ecosystem (Debian/Ubuntu) Today, I focused on the Advanced Package Tool (APT), the backbone of software management in the Ubuntu/Debian world. Here’s a breakdown of the vital commands every admin must know: 1. sudo apt update: This isn’t just an "update" command. It synchronizes your local package index with the remote repositories. It’s the "inventory check" before you start any work. 2. sudo apt upgrade: Once your index is ready, this command actually installs the available updates for all your software. It’s the key to keeping your system secure and patched. 3. sudo apt install [package]: The magic wand! Whether it’s nginx for a web server or git for version control, this command pulls the software and all its necessary dependencies automatically. 4. sudo apt remove vs sudo apt purge: I learned the crucial difference today. remove deletes the app, but purge wipes the configuration files too. Cleanliness is next to godliness in a server! 5. apt search [keyword]: Lost in a sea of software? This helps you find exactly what you need within the massive official repositories. The Philosophy of a SysAdmin: It’s not just about installing software; it’s about Life Cycle Management. A professional administrator knows when to update, what to remove to save resources, and how to keep the environment lean and secure. Community Challenge: In your production environments, do you prefer a fully automated update schedule (unattended-upgrades), or do you like to manually vet every update before hitting that upgrade command? Let's talk about stability vs. automation in the comments! 👇 #Linux #SystemAdministration #PackageManagement #APT #Ubuntu #OpenSource #DevOps #TechCommunity #Day6 #SoftwareArchitecture #SysAdminLearning Gigs 1. https://lnkd.in/d5DGtJrZ Gigs 2. https://lnkd.in/d5axPH_9 Gigs 3. https://lnkd.in/dZUbXrSz
To view or add a comment, sign in
-
-
🆕 My latest blog post! Three decades on the terminal, and I still think faster there than anywhere else. I wrote down the Bash commands I actually reach for every day. It's not an exhaustive reference, but the patterns that genuinely save me time with navigating, searching, processing, and more. This covers the daily workflow, the pipelines that replace 20-line scripts (grep | awk | sort | uniq -c | sort -rn | head - you know the one), the macOS vs Linux issues that trip everyone up, and the modern alternatives worth adopting (ripgrep, fd, jq, yq, ncdu). If you live in the terminal (or want to) this is something that should help. https://lnkd.in/ev2NEPag #Bash #Linux #DevOps #AWS #Terminal
To view or add a comment, sign in
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development