summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2011-10-20 11:40:28 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2011-10-20 11:40:28 +0000
commita6b50df75f7a4552a3473a2f294cdd6b517d015b (patch)
tree8588e637f6cdb262a7a210bc0c2d89db44226556 /app-crypt/ekeyd/files/ekey-ulusbd.init.2
parentRestrict tests on 3.3 series. (diff)
downloadgentoo-2-a6b50df75f7a4552a3473a2f294cdd6b517d015b.tar.gz
gentoo-2-a6b50df75f7a4552a3473a2f294cdd6b517d015b.tar.bz2
gentoo-2-a6b50df75f7a4552a3473a2f294cdd6b517d015b.zip
Remove old 1.1.3 ebuild; revbump 1.1.4 to use new init scripts that are OpenRC-specific, and thus much shorter. The WATERMARK option has been dropped from ekey-egd-linux, as it should be set in sysctl.conf instead.
(Portage version: 2.2.0_alpha69/cvs/Linux x86_64)
Diffstat (limited to 'app-crypt/ekeyd/files/ekey-ulusbd.init.2')
-rw-r--r--app-crypt/ekeyd/files/ekey-ulusbd.init.241
1 files changed, 41 insertions, 0 deletions
diff --git a/app-crypt/ekeyd/files/ekey-ulusbd.init.2 b/app-crypt/ekeyd/files/ekey-ulusbd.init.2
new file mode 100644
index 000000000000..fd7192d10f0b
--- /dev/null
+++ b/app-crypt/ekeyd/files/ekey-ulusbd.init.2
@@ -0,0 +1,41 @@
+#!/sbin/runscript
+# Copyright 2009-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-crypt/ekeyd/files/ekey-ulusbd.init.2,v 1.1 2011/10/20 11:40:27 flameeyes Exp $
+
+INSTANCE="${SVCNAME#*.}"
+if [ -z "${INSTANCE}" -o "${SVCNAME}" = "ekey-ulusbd" ]; then
+ INSTANCE="ekey-ulusbd"
+fi
+
+: ${SOCKET_PATH:=/var/run/ekey-ulusbd-${EKEY_SERIAL}}
+
+description="EntropyKey Userland USB Daemon"
+
+pidfile=/var/run/$SVCNAME.pid
+command=/usr/libexec/ekey-ulusbd
+command_args="-P ${pidfile} -p ${SOCKET_PATH}"
+
+depend() {
+ need localmount
+}
+
+start() {
+ if [ -z ${USB_BUS} ]; then
+ set -- $(lsusb -v -d 20df:0001 | \
+ egrep '(^Bus|iSerial)' | \
+ grep -B1 "${EKEY_SERIAL}" | \
+ head -n 1 | \
+ cut -c 5-7,15-18)
+ USB_BUS=$1
+ USB_DEV=$2
+ fi
+
+ ebegin "Starting ${description}"
+ start-stop-daemon \
+ --start --pidfile ${pidfile} \
+ --exec ${command} -- \
+ ${command_args} \
+ -b $(printf %03d ${USB_BUS}) -d $(printf %03d ${USB_DEV}) -D
+ eend $?
+}