move bw managed systemd units to /usr/local/lib

This commit is contained in:
mwiegand 2022-03-31 10:23:57 +02:00
parent 31bf80f771
commit 49346ba20b
5 changed files with 20 additions and 5 deletions

View file

@ -114,6 +114,6 @@ for name, conf in node.metadata.get('flask').items():
svc_systemd[name] = {
'needs': [
f'action:flask_{name}_pip_install',
f'file:/etc/systemd/system/{name}.service',
f'file:/usr/local/lib/systemd/system/{name}.service',
],
}

View file

@ -70,7 +70,7 @@ for name, config in node.metadata.get('left4dead2/servers').items():
}
svc_systemd[f'left4dead2-server-{name}'] = {
'needs': [
f'file:/etc/systemd/system/left4dead2-server-{name}.service',
f'file:/usr/local/lib/systemd/system/left4dead2-server-{name}.service',
],
}
server_units.add(f'left4dead2-server-{name}')
@ -87,7 +87,7 @@ for id in node.metadata.get('left4dead2/workshop'):
# TIDYUP
find_obsolete_units = (
'find /etc/systemd/system -type f -name "left4dead2-server-*.service" ' +
'find /usr/local/lib/systemd/system -type f -name "left4dead2-server-*.service" ' +
' '.join(f"! -name '{name}.service'" for name in server_units)
)
actions['remove_obsolete_left4dead2_units'] = {

View file

@ -54,6 +54,6 @@ actions = {
svc_systemd['steam-update'] = {
'running': False,
'needs': {
'file:/etc/systemd/system/steam-update.service',
'file:/usr/local/lib/systemd/system/steam-update.service',
}
}

View file

@ -1,5 +1,11 @@
# SYSTEMD
## show unit paths
```
systemctl --no-pager --property=UnitPath show | tr ' ' '\n'
```
## metadata
```python

View file

@ -1,5 +1,14 @@
from bundlewrap.utils.dicts import merge_dict
directories = {
'/usr/local/lib/systemd/system': {
'purge': True,
'triggers': [
"action:systemd-reload",
],
},
}
actions = {
'systemd-reload': {
'command': 'systemctl daemon-reload',
@ -22,7 +31,7 @@ for name, unit in node.metadata.get('systemd/units').items():
],
}
elif extension in ['timer', 'service', 'mount', 'swap']:
path = f'/etc/systemd/system/{name}'
path = f'/usr/local/lib/systemd/system/{name}'
dependencies = {
'triggers': [
"action:systemd-reload",