summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/clair/files/clair.initd')
-rw-r--r--dev-util/clair/files/clair.initd24
1 files changed, 24 insertions, 0 deletions
diff --git a/dev-util/clair/files/clair.initd b/dev-util/clair/files/clair.initd
new file mode 100644
index 000000000000..b98d295c46b9
--- /dev/null
+++ b/dev-util/clair/files/clair.initd
@@ -0,0 +1,24 @@
+#!/sbin/openrc-run
+# Copyright 2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="Clair Vulnerability Static Analysis for Containers"
+pidfile=${pidfile:-"/run/${SVCNAME}/${SVCNAME}.pid"}
+user=${user:-${SVCNAME}}
+group=${group:-${SVCNAME}}
+
+command="/usr/bin/clair"
+command_args="${command_args:--config=/etc/clair/config.yaml}"
+command_background="true"
+start_stop_daemon_args="--user ${user} --group ${group} \
+ --stdout /var/log/${SVCNAME}/${SVCNAME}.log \
+ --stderr /var/log/${SVCNAME}/${SVCNAME}.log"
+
+depend() {
+ need net
+ after net
+}
+
+start_pre() {
+ checkpath -d -m 0755 -o "${user}":"${group}" "${pidfile%/*}"
+}