The following steps show how to create a unit file for Emacs, so that it can be handled like a service.
System Administrators often need to configure and run multiple instances of a service.
– wildcard strings that are dynamically replaced with unit parameters when the unit file is loaded.
This enables creation of generic unit files that serve as templates for generating instantiated units.
Converting an init script to a unit file requires analyzing the script and extracting the necessary information from it.
Based on this data you can create a unit file as described in Section 10.6.2, “Creating Custom Unit Files”.
For example, in case of contains three numerical values.
There are several use cases for creating unit files from scratch: you could run a custom daemon, create a second instance of some existing service (as in Example 10.19, “Creating a second instance of the sshd service”), or import a Sys V init script (more in Section 10.6.3, “Converting Sys V Init Scripts to Unit Files”).Note that the graphical.target depends on multiuser.target, therefore it is not necessary to specify both, as in Example 10.17, “postfix.service Unit File”.You might find information on default and forbidden runlevels also at The other two values specified on the #chkconfig line represent startup and shutdown priorities of the init script.On the other hand, if you intend just to modify or extend the behavior of an existing unit, use the instructions from Section 10.6.4, “Modifying Existing Unit Files”.The following procedure describes the general process of creating a custom service: text editor, it is often faster and more convenient to have it running in the background instead of starting a new instance of the program whenever editing a file.