⚙️ Command: systemctl (System & Service Control)
The systemctl command is the primary tool for controlling the systemd init system and service manager. On Arch Linux, almost everything—from your network and display manager to your Supabase local database—is managed as a "unit" via systemctl.
1. The "Why"
In your Arch environment, systemctl is how you manage the "background" of your OS.
- Manage GUIs: Start or restart your display manager (like SDDM or GDM) if your Hyprland session crashes.
- Network Control: Enable or disable
NetworkManagerto troubleshoot connectivity. - Development Services: Start your local database or web server for your documentation viewer project.
- System Maintenance: Safely reboot or power off your PC from the terminal.
2. The Core Service Lifecycle
Most of your time will be spent using these five actions on "services" (files ending in .service).
| Action | Command | What it does |
|---|---|---|
| Start | sudo systemctl start [name] |
Runs the service immediately (stops when you reboot). |
| Stop | sudo systemctl stop [name] |
Stops the service immediately. |
| Restart | sudo systemctl restart [name] |
Stops and then starts the service (useful after config changes). |
| Enable | sudo systemctl enable [name] |
Sets the service to start automatically every time you boot. |
| Disable | sudo systemctl disable [name] |
Prevents the service from starting at boot. |
3. Practical Examples for Your Setup
A. Checking if a Service is Running
If your Wi-Fi is acting up, check the status of your network manager:
systemctl status NetworkManager
Look for "Active: active (running)" in green.
B. Managing SSH
To allow yourself to ssh into your Arch PC from your phone, you need the SSH daemon running:
sudo systemctl enable --now sshd
(The --now flag is a pro-tip: it enables it for future boots AND starts it immediately in one command.)
C. Dealing with Crashes
If your Bluetooth or Audio stops working:
sudo systemctl restart bluetooth
# or
systemctl --user restart pipewire
4. System-Wide Power Commands
You don't need sudo for these on most modern Arch setups:
- Reboot:
systemctl reboot - Power Off:
systemctl poweroff - Suspend:
systemctl suspend
5. Managing "User" Services
Some services (like your audio server pipewire or some notification daemons) run for your specific user rather than the whole system. You manage these without sudo by adding the --user flag.
systemctl --user status pipewire
6. Pro-Tips
- Finding Services: If you can't remember the exact name of a service, use:
systemctl list-unit-files --type=service - Failed Services: To see a list of everything that failed to start during boot:
systemctl --failed - Journal Integration: If a service fails to start,
systemctlwill tell you to check the logs. Usejournalctl -u [service-name]to see exactly what went wrong. - Arch Linux Context: When you install new hardware drivers or major system components (like a firewall), remember that Arch does not start services automatically upon installation. You must always
enableandstartthem yourself.
7. Summary Reference
| Goal | Command |
|---|---|
| Start and Enable at once | sudo systemctl enable --now [service] |
| Check if service is active | systemctl is-active [service] |
| Reload config without restart | sudo systemctl reload [service] |
| List all running services | systemctl list-units --type=service |