Is there any useful information about writing unit files?
Environment
- Red Hat Enterprise Linux 7
- systemd
Issue
- Is there any useful information about writing unit files?
Resolution
Before you refer to the specific solutions below, you should carefully read and understand section 10.6. Creating and Modifying systemd Unit Files in System Administrator's Guide.
To get some guidance about dependencies as well as some examples, please refer to:
- How to decide what dependencies a systemd service unit definition should have
- How to write a service unit file which enforces that particular services have to be started
To view issues related to things you probably should not do in a script called by systemd defined in a service unit, please refer to:
- The rpm command may core dump with SIGBUS during and after system startup.
- Understanding why a legacy SysV service on RHEL7 gets terminated too early during system shutdown
While Red Hat support cannot write a systemd unit definition for your application, if you have specific questions related to writing systemd unit definitions, please open a support case (there will be a general expectation that you will have reviewed the available systemd documentation, reviewed systemd unit definitions that are shipped with RHEL that may be similar to what you want to achieve, and be aware of the solution articles listed above). This solution article is expected to be a living document and as solution articles are written that may be of general interest in writing systemd unit definitions they will be added here.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.