# Systemctl and Services
systemd
is a system and service manager for Linux operating systems, designed
for the management and configuration of "services", which are programs that run
in the background (such as Nibiru nodes) without user intervention.
systemctl
is a command-line tool that interacts with systemd
.
TLDR: Quick Start: Systemctl for Running Nibiru Nodes
It's recommended to use either Cosmovisor or systemctl
to run
your node.
# What is a service?
In essence, a "service" in this context is like an "app" on your phone that runs in the background, checking for updates or notifications, without you having to manually open it.
Services can range from simple daemons that log system activity to complex software like web servers or databases. Systems are distinct from user-interactive applications that you might launch from a desktop environment.
In the realm of Linux and Unix-like operating systems, these background processes have traditionally been called "daemons", hence the "d" at the end of many service names (e.g. systemd, nibid).
# Systemctl
The systemctl
command-line tool is a crucial component provided by systemd
.
It allows users to introspect and control the state of the systemd
system and
service manager. With systemctl
, operations like starting, halting, or
rebooting services become straightforward.
# Understanding Service Units
Within systemd
, each service is overseen by a
service unit. This unit contains configuration details that dictate how the
service starts, stops, and operates during its runtime.
The service unit defines things like what command to run to start the service, what files or other services it depends on, and various other parameters.
By defining and controlling these services, systemd
allows for:
- Parallelization: Services can be started concurrently during the boot process to reduce boot time.
- Dependency Handling: Services can be set to start only after certain conditions are met, like other services starting first.
- Automatic Recovery: If a service crashes,
systemd
can be configured to restart it. - Resource Control: Set limits on the amount of resources (CPU, memory) a service can use.
# Quick Start: Systemctl for Running Nibiru Nodes
If you have not installed nibid
, please install the required version of the binary (e.g. vX.Y.Z) using the following command:
Create a service file.
Executing the following command will create a service definition for
nibid
in the directory for systemd configuration (/etc/systemd/system
).Be sure to fill in the placeholder variables like
<your_user>
and<your_user_group>
before copying the command. If you're which value to put as your "user", it's the value returned by runningwhoami
in the terminal.Enable the service
This makes sure that the service starts automatically.