Service Management
Overview
Services (also called daemons) are programs running in the background that provide various system functions. Modern Linux systems use systemd as init system and service manager.
systemd Introduction
systemd is the init system for most modern Linux distributions, responsible for:
- Booting the system
- Managing services
- Managing mount points
- Managing devices
- Managing logs
Core Concepts
Unit File Locations
systemctl Commands
Managing Services
Enable at Boot
List Services
System Status
Power Management
Writing Service Unit Files
Basic Structure
[Unit] Section
[Service] Section
Type Types
Restart Policies
[Install] Section
Example: Node.js Application
Example: Python Application
Creating and Enabling Service
Viewing Logs
journalctl
Scheduled Tasks: Timer
Timer Unit File
Timer Time Format
Managing Timer
Traditional init Systems
service Command
update-rc.d (Debian Family)
Summary
This chapter introduced Linux service management:
- systemctl commands: Start, stop, restart, enable services
- Writing service files: Unit, Service, Install sections
- Log management: journalctl
- Scheduled tasks: Timer units
systemd is the core of modern Linux systems; mastering it is an essential skill for system administration.
Previous chapter: Package Management
Next chapter: Network Basics