Introduction
The systemctl command is the main tool to interact with systemd, the init and services manager that has replaced the traditional SysV init in most modern Linux distributions. With systemctl you can start, stop, restart, enable or consult the status of the services, as well as manage assembly units, sockets and timers. Dominating systemctl is essential for any system manager or advanced user who wants to maintain a stable and secure Linux environment.
What is systemd and systemctl?
Systemd is a component suite that provides a framework for system initialization and service management. It acts as the PID 1 process and is responsible for launching the other processes during the start. Systemctl, for its part, is the command line interface that allows users to communicate with the Systemd demon. Through systemctl you can send instructions such as start, stop, relax, enable or disable to any unit defined in the system.
Basic Syntax of Systemctl
The general syntax is: systemctl [options] command nombre.unit. The units can be of type .service, .socket, .mount, .target, etc. If you miss the extension, systemctl assumes .service by default.
- systemctl start apache2.service
- systemctl stop sshd
- systemctl restart nginx
- systemctl relaad postgresql
Useful options include -now to apply changes immediately and -global to affect all user instances.
Manage services (start, stop, restart, relax)
Initiating a service with systemctl start puts it in place immediately, while systemctl stop it. The systemctl restart command combines stop and start, useful after changing settings. If you only need to recharge the configuration files without interrupting the service, systemctl relaad sends a SIghUP signal to the process, which makes you reread your configuration without falling.
Enable and disable start-up services
For a service to start automatically every time the system starts, it is used systemctl able nombre.servic. This creates a symbolic link from the appropriate destination directory (for example, multi- user.target.want) to the drive file. The opposite, disable systemctl, removes those links and prevents automatic boot. You can combine able and start with the -now: systemctl able -now nginx option.
See status and logos (status, journalctl)
The systemctl status nombre.service command shows detailed information: if it is active, your PID, the latest output messages and the control tree (cgroup). To see the records generated by the service, journalctl -u nombre.service is used, which allows you to filter for time, priority or keywords. This combination is key to quickly diagnose failure.
Other useful commands
- Systemctl list-unit-files -type = service shows all service units and if they are enabled or disabled.
- Systemctl is-active nombre.service indicates whether the service is currently active (running) or inactive.
- systemctl is-enabled nombre.service responds if it is enabled to boot.
- Systemctl list-dependencies nombre.service shows which other units are required or activated together with it.
- Systemctl daemon-relaad recharges the system configuration after modifying drive files.
Good practices and advice
- Always check the status before and after making changes with systemctl status.
- Use the -failed option to list only the units that failed to start.
- Avoid using kill directly in processes managed by systemd; instead, trust systemctl stop or kill to send controlled signals.
- Keep the system up to date to benefit from system improvements and security corrections.
- It documents any changes in the configuration of units in a version control system to facilitate the audit.
Conclusion
Systemctl has become an indispensable part of the modern Linux ecosystem. Its unified and powerful interface allows efficient, safe and reproducible management of services. Whether you are a system manager in charge of production servers or an enthusiast you experience in your workstation, mastering systemctl provides you with the necessary control to keep your Linux environment running smoothly.


