afm-unit.conf: force symbolic link on update 59/16959/4
authorRomain Forlot <romain.forlot@iot.bzh>
Fri, 5 Oct 2018 14:29:51 +0000 (16:29 +0200)
committerRomain Forlot <romain.forlot@iot.bzh>
Fri, 5 Oct 2018 14:42:58 +0000 (16:42 +0200)
Forcing symbolic link update ensures that if the value changes
the link will be overwriten. Otherwise the link always
keeps the old path until a system reboot or a manual removal
of the link file.

Change-Id: Ib9d8f267a8665edd75ce04f77eb70c4b0a4b8e9f
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
conf/unit/afm-unit-debug.conf.in
conf/unit/afm-unit.conf.in
conf/unit/generate-unit-conf/provided-binding.inc

index 01d3c2e..accf8ca 100644 (file)
@@ -277,7 +277,7 @@ After=afm-user-setup@%i.service
 [Service]
 Type=oneshot
 RemainAfterExit=yes
-ExecStart=/bin/ln -s {{:#metadata.install-dir}}/{{value}} @afm_users_rundir@/%i/apis/link/{{name}}
+ExecStart=/bin/ln -sf {{:#metadata.install-dir}}/{{value}} @afm_users_rundir@/%i/apis/link/{{name}}
 %end systemd-unit
 {{/provided-binding}}
 {{/targets}}
index 74c57ea..e1d2112 100644 (file)
@@ -277,7 +277,7 @@ After=afm-user-setup@%i.service
 [Service]
 Type=oneshot
 RemainAfterExit=yes
-ExecStart=/bin/ln -s {{:#metadata.install-dir}}/{{value}} @afm_users_rundir@/%i/apis/link/{{name}}
+ExecStart=/bin/ln -sf {{:#metadata.install-dir}}/{{value}} @afm_users_rundir@/%i/apis/link/{{name}}
 %end systemd-unit
 {{/provided-binding}}
 {{/targets}}
index a5636ee..c60b0dc 100644 (file)
@@ -24,7 +24,7 @@ After=afm-user-setup@%i.service
 [Service]
 Type=oneshot
 RemainAfterExit=yes
-ExecStart=/bin/ln -s {{:#metadata.install-dir}}/{{value}} USER_RUN_DIR/apis/link/{{name}}
+ExecStart=/bin/ln -sf {{:#metadata.install-dir}}/{{value}} USER_RUN_DIR/apis/link/{{name}}
 
 %end systemd-unit