Run in the background
Run the Node in the Background
While you've probably used the persistenceCore start
command in a terminal, you might question yourself what happens if you exit the window, stop the node by mistake, or need to restart your server. The answer is services. Imagine a service as a container for processes. It allows the Persistence Core-1 node to run in the background while providing us with access to logs. Not to mention it's starting automatically on system (re)boot. In this section we will cover systemd
.
Running a service using systemd
is straightforward. While systemd
itself provides many configuration options, we only need a few to run the Persistence Core-1 node. Let's get started.
Since
systemd
is installed by default, there are no installation steps.First, we need to create a service file in
/etc/systemd/system
. Let's name itcore-1.service
.Now, with the file created and open, we need to populate it with the correct options to run the Persistence Core-1 Node.
Next, we need to reload systemd and enable the service.
All that's left to do is to start it.
Although you may think nothing has happened, the service is running in the background. To access its logs and see if it's running as it should use the following command:
To check the status of the service, you can run:
Additional commands:
Last updated