python3-cyberfusion-systemd-support 1.1.1.3__tar.gz → 2.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python3_cyberfusion_systemd_support-1.1.1.3 → python3_cyberfusion_systemd_support-2.1.0}/PKG-INFO +1 -1
- {python3_cyberfusion_systemd_support-1.1.1.3 → python3_cyberfusion_systemd_support-2.1.0}/pyproject.toml +1 -1
- {python3_cyberfusion_systemd_support-1.1.1.3 → python3_cyberfusion_systemd_support-2.1.0}/src/cyberfusion/SystemdSupport/units.py +17 -3
- {python3_cyberfusion_systemd_support-1.1.1.3 → python3_cyberfusion_systemd_support-2.1.0}/src/python3_cyberfusion_systemd_support.egg-info/PKG-INFO +1 -1
- {python3_cyberfusion_systemd_support-1.1.1.3 → python3_cyberfusion_systemd_support-2.1.0}/README.md +0 -0
- {python3_cyberfusion_systemd_support-1.1.1.3 → python3_cyberfusion_systemd_support-2.1.0}/setup.cfg +0 -0
- {python3_cyberfusion_systemd_support-1.1.1.3 → python3_cyberfusion_systemd_support-2.1.0}/src/cyberfusion/SystemdSupport/__init__.py +0 -0
- {python3_cyberfusion_systemd_support-1.1.1.3 → python3_cyberfusion_systemd_support-2.1.0}/src/cyberfusion/SystemdSupport/_constants.py +0 -0
- {python3_cyberfusion_systemd_support-1.1.1.3 → python3_cyberfusion_systemd_support-2.1.0}/src/cyberfusion/SystemdSupport/manager.py +0 -0
- {python3_cyberfusion_systemd_support-1.1.1.3 → python3_cyberfusion_systemd_support-2.1.0}/src/cyberfusion/SystemdSupport/tmp_files.py +0 -0
- {python3_cyberfusion_systemd_support-1.1.1.3 → python3_cyberfusion_systemd_support-2.1.0}/src/python3_cyberfusion_systemd_support.egg-info/SOURCES.txt +0 -0
- {python3_cyberfusion_systemd_support-1.1.1.3 → python3_cyberfusion_systemd_support-2.1.0}/src/python3_cyberfusion_systemd_support.egg-info/dependency_links.txt +0 -0
- {python3_cyberfusion_systemd_support-1.1.1.3 → python3_cyberfusion_systemd_support-2.1.0}/src/python3_cyberfusion_systemd_support.egg-info/requires.txt +0 -0
- {python3_cyberfusion_systemd_support-1.1.1.3 → python3_cyberfusion_systemd_support-2.1.0}/src/python3_cyberfusion_systemd_support.egg-info/top_level.txt +0 -0
{python3_cyberfusion_systemd_support-1.1.1.3 → python3_cyberfusion_systemd_support-2.1.0}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python3-cyberfusion-systemd-support
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.1.0
|
|
4
4
|
Summary: Library for systemd.
|
|
5
5
|
Author-email: Cyberfusion <support@cyberfusion.io>
|
|
6
6
|
Project-URL: Source, https://github.com/CyberfusionIO/python3-cyberfusion-systemd-support
|
|
@@ -12,6 +12,9 @@ from cyberfusion.SystemdSupport.manager import SystemdManager
|
|
|
12
12
|
F = TypeVar("F", bound=Callable[..., None])
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
BASE_DIRECTORY_SYSTEMD_UNITS = os.path.join(os.path.sep, "etc", "systemd", "system")
|
|
16
|
+
|
|
17
|
+
|
|
15
18
|
def reload_manager(f: F) -> F:
|
|
16
19
|
"""Reload manager configuration if needed.."""
|
|
17
20
|
|
|
@@ -34,8 +37,6 @@ class Unit:
|
|
|
34
37
|
|
|
35
38
|
SUFFIX_SERVICE = "service"
|
|
36
39
|
|
|
37
|
-
DIRECTORY_SYSTEMD_OVERRIDE = os.path.join(os.path.sep, "etc", "systemd", "system")
|
|
38
|
-
|
|
39
40
|
def __init__(self, name: str) -> None:
|
|
40
41
|
"""Set attributes."""
|
|
41
42
|
self.name = name
|
|
@@ -57,7 +58,7 @@ class Unit:
|
|
|
57
58
|
@property
|
|
58
59
|
def drop_in_directory(self) -> str:
|
|
59
60
|
"""Get path to drop-in directory."""
|
|
60
|
-
return
|
|
61
|
+
return self.get_drop_in_directory(self.name)
|
|
61
62
|
|
|
62
63
|
@property
|
|
63
64
|
def needs_reload(self) -> bool:
|
|
@@ -107,6 +108,14 @@ class Unit:
|
|
|
107
108
|
"""Restart unit."""
|
|
108
109
|
subprocess.run([SYSTEMCTL_BIN, "restart", self.name], check=True)
|
|
109
110
|
|
|
111
|
+
@reload_manager
|
|
112
|
+
def start(self) -> None:
|
|
113
|
+
"""Start unit."""
|
|
114
|
+
if self.is_active:
|
|
115
|
+
return
|
|
116
|
+
|
|
117
|
+
subprocess.run([SYSTEMCTL_BIN, "start", self.name], check=True)
|
|
118
|
+
|
|
110
119
|
@reload_manager
|
|
111
120
|
def reload(self) -> None:
|
|
112
121
|
"""Reload unit."""
|
|
@@ -135,3 +144,8 @@ class Unit:
|
|
|
135
144
|
return False
|
|
136
145
|
|
|
137
146
|
return True
|
|
147
|
+
|
|
148
|
+
@staticmethod
|
|
149
|
+
def get_drop_in_directory(unit_name: str) -> str:
|
|
150
|
+
"""Get unit override directory."""
|
|
151
|
+
return os.path.join(BASE_DIRECTORY_SYSTEMD_UNITS, unit_name + ".d")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python3-cyberfusion-systemd-support
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.1.0
|
|
4
4
|
Summary: Library for systemd.
|
|
5
5
|
Author-email: Cyberfusion <support@cyberfusion.io>
|
|
6
6
|
Project-URL: Source, https://github.com/CyberfusionIO/python3-cyberfusion-systemd-support
|
{python3_cyberfusion_systemd_support-1.1.1.3 → python3_cyberfusion_systemd_support-2.1.0}/README.md
RENAMED
|
File without changes
|
{python3_cyberfusion_systemd_support-1.1.1.3 → python3_cyberfusion_systemd_support-2.1.0}/setup.cfg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|