summaryrefslogtreecommitdiff
path: root/app-crypt/ekeyd/files/ekeyd.init.2
blob: 5c8bc7658af140ae874a71dcba322dc233cd784e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/sbin/openrc-run
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

INSTANCE="${SVCNAME#*.}"
if [ -z "${INSTANCE}" -o "${SVCNAME}" = "ekeyd" ]; then
	INSTANCE="ekeyd"
fi

description="EntropyKey daemon"

pidfile=/var/run/$SVCNAME.pid
cfgfile=/etc/entropykey/${INSTANCE}.conf

command=/usr/libexec/ekeyd
command_args="-f ${cfgfile} -p ${pidfile}"

depend() {
	 config $cfgfile

	 use udev ekey-ulusbd
	 need localmount

	 # quickly parse the configuration file; we only provide entropy
	 # if we're not using the egd server/client split method.
	 if sed -e 's:--.*::' "${cfgfile}" | grep -q SetOutputToKernel; then
		 provide entropy
	 fi
}