Use arrays for systemd paths

This commit is contained in:
Benoit S 2021-11-20 12:13:57 +09:00
parent c4588cf2b2
commit 02ac9115e4
2 changed files with 14 additions and 6 deletions

View file

@ -30,8 +30,16 @@ systemd = {
'EnvironmentFile': f"/etc/{app['name']}.env", 'EnvironmentFile': f"/etc/{app['name']}.env",
'WorkingDirectory': f"/etc/{app['name']}", 'WorkingDirectory': f"/etc/{app['name']}",
'RootDirectory': f"{undocker['app_dst']}", 'RootDirectory': f"{undocker['app_dst']}",
'ReadWritePaths': '+/etc/linkding', 'ReadWritePaths': [
'BindPaths': f"{data_directories[0]}:/etc/linkding/data", '+/etc/linkding'
'BindReadOnlyPaths': '/etc/resolv.conf /etc/hosts /proc', ],
'BindPaths': [
f"{data_directories[0]}:/etc/linkding/data"
],
'BindReadOnlyPaths': [
'/etc/resolv.conf',
'/etc/hosts',
'/proc'
],
'ExecStart': '/etc/linkding/bootstrap.sh', 'ExecStart': '/etc/linkding/bootstrap.sh',
} }

View file

@ -9,9 +9,9 @@ Group={{ host.data.systemd['Group'] }}
EnvironmentFile={{ host.data.systemd['EnvironmentFile'] }} EnvironmentFile={{ host.data.systemd['EnvironmentFile'] }}
WorkingDirectory={{ host.data.systemd['WorkingDirectory'] }} WorkingDirectory={{ host.data.systemd['WorkingDirectory'] }}
RootDirectory={{ host.data.systemd['RootDirectory'] }} RootDirectory={{ host.data.systemd['RootDirectory'] }}
ReadWritePaths={{ host.data.systemd['ReadWritePaths'] }} ReadWritePaths={{ host.data.systemd['ReadWritePaths'] | join(' ') }}
BindPaths={{ host.data.systemd['BindPaths'] }} BindPaths={{ host.data.systemd['BindPaths'] | join(' ') }}
BindReadOnlyPaths={{ host.data.systemd['BindReadOnlyPaths'] }} BindReadOnlyPaths={{ host.data.systemd['BindReadOnlyPaths'] | join(' ') }}
ExecStart={{ host.data.systemd['ExecStart'] }} ExecStart={{ host.data.systemd['ExecStart'] }}
KillSignal=SIGQUIT KillSignal=SIGQUIT
Restart=on-failure Restart=on-failure