diff options
author | Phil Wise <phil@advancedtelematic.com> | 2018-03-14 16:00:53 +0100 |
---|---|---|
committer | Phil Wise <phil@advancedtelematic.com> | 2018-03-14 16:00:53 +0100 |
commit | 66a4721d0b7885a18db952d69f7ee385a95b2f2b (patch) | |
tree | 435221c02bad0e8ba4d89350d3c98efaf8be5d53 /recipes-sota/aktualizr | |
parent | bbce1809a921e627678947e9585ea15223b181d9 (diff) | |
download | meta-updater-66a4721d0b7885a18db952d69f7ee385a95b2f2b.tar.gz |
Add systemd socket activation for secondary
Diffstat (limited to 'recipes-sota/aktualizr')
-rw-r--r-- | recipes-sota/aktualizr/aktualizr_git.bb | 15 | ||||
-rw-r--r-- | recipes-sota/aktualizr/files/aktualizr-secondary.service | 9 | ||||
-rw-r--r-- | recipes-sota/aktualizr/files/aktualizr-secondary.socket | 5 |
3 files changed, 28 insertions, 1 deletions
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index ad06339..5e683ac 100644 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb | |||
@@ -18,9 +18,11 @@ PR = "7" | |||
18 | SRC_URI = " \ | 18 | SRC_URI = " \ |
19 | gitsm://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \ | 19 | gitsm://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \ |
20 | file://aktualizr.service \ | 20 | file://aktualizr.service \ |
21 | file://aktualizr-secondary.service \ | ||
22 | file://aktualizr-secondary.socket \ | ||
21 | file://aktualizr-serialcan.service \ | 23 | file://aktualizr-serialcan.service \ |
22 | " | 24 | " |
23 | SRCREV = "dca6271f4ec06eb2272cc99b4b9cf76a9805f18d" | 25 | SRCREV = "fbb3404824c4eb239455c7fa1a794c26e2ea954d" |
24 | BRANCH ?= "master" | 26 | BRANCH ?= "master" |
25 | 27 | ||
26 | S = "${WORKDIR}/git" | 28 | S = "${WORKDIR}/git" |
@@ -28,7 +30,10 @@ S = "${WORKDIR}/git" | |||
28 | inherit cmake | 30 | inherit cmake |
29 | 31 | ||
30 | inherit systemd | 32 | inherit systemd |
33 | |||
34 | SYSTEMD_PACKAGES = "${PN} ${PN}-secondary" | ||
31 | SYSTEMD_SERVICE_${PN} = "aktualizr.service" | 35 | SYSTEMD_SERVICE_${PN} = "aktualizr.service" |
36 | SYSTEMD_SERVICE_${PN}-secondary = "aktualizr-secondary.socket" | ||
32 | 37 | ||
33 | BBCLASSEXTEND =+ "native" | 38 | BBCLASSEXTEND =+ "native" |
34 | 39 | ||
@@ -39,6 +44,11 @@ EXTRA_OECMAKE_append_class-native = " -DBUILD_SOTA_TOOLS=ON -DBUILD_OSTREE=OFF - | |||
39 | do_install_append () { | 44 | do_install_append () { |
40 | rm -fr ${D}${libdir}/systemd | 45 | rm -fr ${D}${libdir}/systemd |
41 | rm -f ${D}${libdir}/sota/sota.toml # Only needed for the Debian package | 46 | rm -f ${D}${libdir}/sota/sota.toml # Only needed for the Debian package |
47 | install -d ${D}${libdir}/sota | ||
48 | install -m 0644 ${S}/config/sota_secondary.toml ${D}/${libdir}/sota/sota_secondary.toml | ||
49 | install -d ${D}${systemd_unitdir}/system | ||
50 | install -m 0644 ${WORKDIR}/aktualizr-secondary.socket ${D}${systemd_unitdir}/system/aktualizr-secondary.socket | ||
51 | install -m 0644 ${WORKDIR}/aktualizr-secondary.service ${D}${systemd_unitdir}/system/aktualizr-secondary.service | ||
42 | } | 52 | } |
43 | do_install_append_class-target () { | 53 | do_install_append_class-target () { |
44 | install -d ${D}${systemd_unitdir}/system | 54 | install -d ${D}${systemd_unitdir}/system |
@@ -84,6 +94,9 @@ FILES_${PN}-host-tools = " \ | |||
84 | 94 | ||
85 | FILES_${PN}-secondary = " \ | 95 | FILES_${PN}-secondary = " \ |
86 | ${bindir}/aktualizr-secondary \ | 96 | ${bindir}/aktualizr-secondary \ |
97 | ${libdir}/sota/sota_secondary.toml \ | ||
98 | ${systemd_unitdir}/system/aktualizr-secondary.socket \ | ||
99 | ${systemd_unitdir}/system/aktualizr-secondary.service \ | ||
87 | " | 100 | " |
88 | 101 | ||
89 | # Both primary and secondary need the SQL Schemas | 102 | # Both primary and secondary need the SQL Schemas |
diff --git a/recipes-sota/aktualizr/files/aktualizr-secondary.service b/recipes-sota/aktualizr/files/aktualizr-secondary.service new file mode 100644 index 0000000..a1e0e1b --- /dev/null +++ b/recipes-sota/aktualizr/files/aktualizr-secondary.service | |||
@@ -0,0 +1,9 @@ | |||
1 | [Unit] | ||
2 | Description=Aktualizr SOTA Client (UPTANE Secondary) | ||
3 | |||
4 | [Service] | ||
5 | RestartSec=10 | ||
6 | Restart=always | ||
7 | EnvironmentFile=-/etc/sota/sota.env | ||
8 | ExecStart=/usr/bin/aktualizr-secondary --config /usr/lib/sota/sota_secondary.toml | ||
9 | |||
diff --git a/recipes-sota/aktualizr/files/aktualizr-secondary.socket b/recipes-sota/aktualizr/files/aktualizr-secondary.socket new file mode 100644 index 0000000..1cb4269 --- /dev/null +++ b/recipes-sota/aktualizr/files/aktualizr-secondary.socket | |||
@@ -0,0 +1,5 @@ | |||
1 | [Socket] | ||
2 | ListenStream=9030 | ||
3 | |||
4 | [Install] | ||
5 | WantedBy=sockets.target \ No newline at end of file | ||