|
| 1 | += Decide on handling and location of systemd unit files |
| 2 | +Sönke Liebau < soenke[email protected]> |
| 3 | +v1.0, 07.01.2021 |
| 4 | +:status: accepted |
| 5 | + |
| 6 | +* Status: {status} |
| 7 | +* Deciders: |
| 8 | +** Lars Francke |
| 9 | +** Sönke Liebau |
| 10 | +* Date: 07.01.2021 |
| 11 | +
|
| 12 | +== Context and Problem Statement |
| 13 | + |
| 14 | +The agent will need to create systemd unit files for every service that it wants to be run. |
| 15 | +Systemd has a couple of directories where these files can be placed and offers ways of adding non-standard directories to that list. |
| 16 | +We need to decide where to put these files. |
| 17 | + |
| 18 | +== Decision Drivers |
| 19 | + |
| 20 | +* Familiarity of admins with solution |
| 21 | +* Added complexity |
| 22 | +* Implementation effort |
| 23 | +* Making cleanup of a server as easy as possible if Stackable stack is removed |
| 24 | + |
| 25 | +== Considered Options |
| 26 | + |
| 27 | +* Use $SYSTEMD_UNIT_PATH to globally add a new directory |
| 28 | +* Symlink unit files to default location |
| 29 | +* Create unit files in default location |
| 30 | + |
| 31 | +== Decision Outcome |
| 32 | + |
| 33 | +Chosen option: "Create unit files in default location" |
| 34 | + |
| 35 | +We loose no functionality over any of the other options, but it is far easier to implement and has less added complexity for the sysadmins. |
| 36 | + |
| 37 | +We will put unit files in _/lib/systemd/system_ which is the proper directory for unit files provided by installed packages. |
| 38 | +_/etc/systemd/system_ is a directory with higher priority for user created units, not using this directory gives admins the option of creating a temporary override unit file here for testing/debugging/... purposes. |
| 39 | + |
| 40 | +=== Positive Consequences |
| 41 | + |
| 42 | +* Admins will find the unit files where they are used to finding them |
| 43 | +* Implementation effort is low |
| 44 | +* Least invasive and no risk of outdated files still being linked as current |
| 45 | + |
| 46 | +=== Negative Consequences |
| 47 | + |
| 48 | +* No versioning of unit files, as the current one will always be overwritten (this can be mitigated by keeping a copy of all unit files in our config dir) |
| 49 | + |
| 50 | +== Pros and Cons of the Options |
| 51 | + |
| 52 | +=== Use $SYSTEMD_UNIT_PATH to globally add a new directory |
| 53 | + |
| 54 | +* Good, because this would completely isolate our unit files from the rest of the system |
| 55 | +* Bad, because this appears to be functionality used only for testing |
| 56 | +* Bad, because setting this environment variable would need to be done very early during system startup, necessitating potentially dangerous changes to the server |
| 57 | +* Bad, because this would create an unusual place to look for unit files that sysadmins are not aware of |
| 58 | + |
| 59 | +=== Symlink unit files to default location |
| 60 | + |
| 61 | +* Good, because it would allow us to keep unit files in a central location |
| 62 | +* Bad, because it adds a level of indirection that sysadmins are probably not used to |
| 63 | +* Bad, because it creates the possibility of symlinks pointing at wrong unit files (if we version unit files) |
| 64 | + |
| 65 | +=== Create unit files in default location |
| 66 | + |
| 67 | +* Good, because it is known and expected behavior |
| 68 | +* Good, because it is the quickest solution to implement |
| 69 | +* Bad, because it is a little bit more invasive than alternatives |
0 commit comments