Custom systemd Unit and Unit File

From NovaOrdis Knowledge Base
Revision as of 05:50, 16 February 2016 by Ovidiu (talk | contribs)
Jump to navigation Jump to search

External

Internal

Overview

This article describes the procedure to configure an arbitrary service myservice to be managed by systemd. It includes the creation of corresponding unit file and systemd configuration to start/stop the service automatically at boot/shutdown.

Important Note

This procedure was not tested step-by-step. When I have a concrete case that can be used for testing, revisit and update.


Create the Unit File

Create the /etc/systemd/system/myservice.service unit file. For more details on the location of the unit files, see [[]].

touch /etc/systemd/system/myservice.service
chmod 644 /etc/systemd/system/myservice.service