Skip to content

Commit

Permalink
Fail for systemd <243, required by OOMPolicy feature added since v0.17
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed May 25, 2023
1 parent cef1a25 commit 8b4f8fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ The following features are currently available:
### Systemd and Linux distributions

SystemdSpawner 1 is recommended to be used with systemd version 245 or higher,
but _may_ work with systemd version 235-244 as well. Below are examples of Linux
but _may_ work with systemd version 243-244 as well. Below are examples of Linux
distributions that use systemd and has a recommended version.

- Ubuntu 20.04+
Expand Down
8 changes: 3 additions & 5 deletions systemdspawner/systemdspawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from systemdspawner import systemd

SYSTEMD_REQUIRED_VERSION = 235
SYSTEMD_REQUIRED_VERSION = 243
SYSTEMD_LOWEST_RECOMMENDED_VERSION = 245


Expand Down Expand Up @@ -135,8 +135,6 @@ class SystemdSpawner(Spawner):
See http://0pointer.net/blog/dynamic-users-with-systemd.html for more
information.
Requires systemd 235.
""",
).tag(config=True)

Expand Down Expand Up @@ -166,12 +164,12 @@ def __init__(self, *args, **kwargs):
)
elif systemd_version < SYSTEMD_REQUIRED_VERSION:
self.log.critical(
f"systemd version 235 or higher is required, version {systemd_version} is used"
f"systemd version {SYSTEMD_REQUIRED_VERSION} or higher is required, version {systemd_version} is used"
)
sys.exit(1)
elif systemd_version < SYSTEMD_LOWEST_RECOMMENDED_VERSION:
self.log.warning(
f"systemd version 245 or higher is recommended, version {systemd_version} is used"
f"systemd version {SYSTEMD_LOWEST_RECOMMENDED_VERSION} or higher is recommended, version {systemd_version} is used"
)

def _expand_user_vars(self, string):
Expand Down

0 comments on commit 8b4f8fd

Please sign in to comment.