From 02ac9115e47fb94d54f66b10a5ca8d8ca85019c9 Mon Sep 17 00:00:00 2001 From: Benoit S Date: Sat, 20 Nov 2021 12:13:57 +0900 Subject: [PATCH] Use arrays for systemd paths --- group_data/all.py | 14 +++++++++++--- templates/systemd.service.j2 | 6 +++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/group_data/all.py b/group_data/all.py index 701cb6e..e93c17c 100644 --- a/group_data/all.py +++ b/group_data/all.py @@ -30,8 +30,16 @@ systemd = { 'EnvironmentFile': f"/etc/{app['name']}.env", 'WorkingDirectory': f"/etc/{app['name']}", 'RootDirectory': f"{undocker['app_dst']}", - 'ReadWritePaths': '+/etc/linkding', - 'BindPaths': f"{data_directories[0]}:/etc/linkding/data", - 'BindReadOnlyPaths': '/etc/resolv.conf /etc/hosts /proc', + 'ReadWritePaths': [ + '+/etc/linkding' + ], + 'BindPaths': [ + f"{data_directories[0]}:/etc/linkding/data" + ], + 'BindReadOnlyPaths': [ + '/etc/resolv.conf', + '/etc/hosts', + '/proc' + ], 'ExecStart': '/etc/linkding/bootstrap.sh', } \ No newline at end of file diff --git a/templates/systemd.service.j2 b/templates/systemd.service.j2 index ed2d333..a1e47a7 100644 --- a/templates/systemd.service.j2 +++ b/templates/systemd.service.j2 @@ -9,9 +9,9 @@ Group={{ host.data.systemd['Group'] }} EnvironmentFile={{ host.data.systemd['EnvironmentFile'] }} WorkingDirectory={{ host.data.systemd['WorkingDirectory'] }} RootDirectory={{ host.data.systemd['RootDirectory'] }} -ReadWritePaths={{ host.data.systemd['ReadWritePaths'] }} -BindPaths={{ host.data.systemd['BindPaths'] }} -BindReadOnlyPaths={{ host.data.systemd['BindReadOnlyPaths'] }} +ReadWritePaths={{ host.data.systemd['ReadWritePaths'] | join(' ') }} +BindPaths={{ host.data.systemd['BindPaths'] | join(' ') }} +BindReadOnlyPaths={{ host.data.systemd['BindReadOnlyPaths'] | join(' ') }} ExecStart={{ host.data.systemd['ExecStart'] }} KillSignal=SIGQUIT Restart=on-failure