commit:     7808ba121a8357413011e681df618b4f8b890653
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 10 10:35:46 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Jan 10 10:37:21 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7808ba12

app-containers/cadvisor: add systemd service file

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 app-containers/cadvisor/cadvisor-0.49.2.ebuild |  3 ++-
 app-containers/cadvisor/files/cadvisor.service | 13 +++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/app-containers/cadvisor/cadvisor-0.49.2.ebuild 
b/app-containers/cadvisor/cadvisor-0.49.2.ebuild
index f732ed47c526..93c595db33e9 100644
--- a/app-containers/cadvisor/cadvisor-0.49.2.ebuild
+++ b/app-containers/cadvisor/cadvisor-0.49.2.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit go-module
+inherit go-module systemd
 
 COMMIT=6876475afe3755d62b65df0d32b005047fc69377
 
@@ -40,6 +40,7 @@ src_test() {
 
 src_install() {
        newinitd "${FILESDIR}"/${PN}.initd-r1 ${PN}
+       systemd_dounit "${FILESDIR}/${PN}.service"
        dobin _output/${PN}
        keepdir /var/log/${PN}
        fowners ${PN}:${PN} /var/log/${PN}

diff --git a/app-containers/cadvisor/files/cadvisor.service 
b/app-containers/cadvisor/files/cadvisor.service
new file mode 100644
index 000000000000..13966305156f
--- /dev/null
+++ b/app-containers/cadvisor/files/cadvisor.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=cAdvisor - Analyzes resource usage and performance characteristics 
of running containers
+Documentation=https://github.com/google/cadvisor
+After=network-online.target docker.socket
+
+[Service]
+User=cadvisor
+Restart=on-failure
+ExecStart=/usr/bin/cadvisor
+TimeoutStopSec=20s
+
+[Install]
+WantedBy=multi-user.target

Reply via email to