summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2009-09-28 18:29:36 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2009-09-28 18:29:36 +0000
commit4d2a8f5f8a107eb8e692f7e697e165a4795807e7 (patch)
treecf9601b7bc88fd30211f9374575a0af9f1046bee /app-crypt/ekeyd/files
parentVersion bump. (diff)
downloadgentoo-2-4d2a8f5f8a107eb8e692f7e697e165a4795807e7.tar.gz
gentoo-2-4d2a8f5f8a107eb8e692f7e697e165a4795807e7.tar.bz2
gentoo-2-4d2a8f5f8a107eb8e692f7e697e165a4795807e7.zip
Bump already, add init script for the userland USB daemon, and move the two daemon executables in /usr/libexec.
(Portage version: 2.2_rc42/cvs/Linux x86_64)
Diffstat (limited to 'app-crypt/ekeyd/files')
-rw-r--r--app-crypt/ekeyd/files/ekey-ulusbd.conf16
-rw-r--r--app-crypt/ekeyd/files/ekey-ulusbd.init43
-rw-r--r--app-crypt/ekeyd/files/ekeyd.init8
3 files changed, 63 insertions, 4 deletions
diff --git a/app-crypt/ekeyd/files/ekey-ulusbd.conf b/app-crypt/ekeyd/files/ekey-ulusbd.conf
new file mode 100644
index 000000000000..80bf0c1aec13
--- /dev/null
+++ b/app-crypt/ekeyd/files/ekey-ulusbd.conf
@@ -0,0 +1,16 @@
+# Copyright 2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-crypt/ekeyd/files/ekey-ulusbd.conf,v 1.1 2009/09/28 18:29:36 flameeyes Exp $
+
+# The userland USB daemon has to know the USB path of the EntopyKey to
+# work properly; in alternative to providing these statically, they
+# can be found by giving the serial of the key.
+#
+# The serial will also be used to set the default path to open the
+# socket to.
+
+EKEY_SERIAL=""
+#USB_BUS=""
+#USB_DEV=""
+
+SOCKET_PATH="/var/run/ekey.ulusbd.${EKEY_SERIAL}"
diff --git a/app-crypt/ekeyd/files/ekey-ulusbd.init b/app-crypt/ekeyd/files/ekey-ulusbd.init
new file mode 100644
index 000000000000..f1ee32bcc54a
--- /dev/null
+++ b/app-crypt/ekeyd/files/ekey-ulusbd.init
@@ -0,0 +1,43 @@
+#!/sbin/runscript
+# Copyright 2009 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,v 1.1 2009/09/28 18:29:36 flameeyes Exp $
+
+INSTANCE="${SVCNAME#*.}"
+if [ -z "${INSTANCE}" ] || [ "${SVCNAME}" = "ekey-ulusbd" ]; then
+ INSTANCE="ekey-ulusbd"
+fi
+
+depend() {
+ use udev
+}
+
+start() {
+ if [ -z ${USB_BUS} ]; then
+ local devdir=$(fgrep -l 20df /sys/bus/usb/devices/*/idVendor \
+ | xargs -n1 dirname \
+ | xargs -I{} fgrep -l 0001 {}/idProduct \
+ | xargs -n1 dirname \
+ | xargs -I{} fgrep -l ${EKEY_SERIAL} {}/serial \
+ | xargs -n1 dirname)
+ USB_BUS=$(< ${devdir}/busnum)
+ USB_DEV=$(< ${devdir}/devnum)
+ fi
+
+ ebegin "Starting EntropyKey Userland USB Daemon"
+ start-stop-daemon \
+ --start --pidfile "/var/run/${SVCNAME}.pid" \
+ --exec /usr/libexec/ekey-ulusbd -- \
+ -P "/var/run/${SVCNAME}.pid" \
+ -p "${SOCKET_PATH}" \
+ -b $(printf %03d ${USB_BUS}) -d $(printf %03d ${USB_DEV}) -D
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping EntropyKey daemon"
+ start-stop-daemon \
+ --stop --pidfile "/var/run/${SVCNAME}.pid" \
+ --exec /usr/libexec/ekey-ulusbd
+ eend $?
+}
diff --git a/app-crypt/ekeyd/files/ekeyd.init b/app-crypt/ekeyd/files/ekeyd.init
index 89dab724a46c..5bdfdf17a0c9 100644
--- a/app-crypt/ekeyd/files/ekeyd.init
+++ b/app-crypt/ekeyd/files/ekeyd.init
@@ -1,7 +1,7 @@
#!/sbin/runscript
# Copyright 2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-crypt/ekeyd/files/ekeyd.init,v 1.1 2009/09/28 10:59:07 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-crypt/ekeyd/files/ekeyd.init,v 1.2 2009/09/28 18:29:36 flameeyes Exp $
INSTANCE="${SVCNAME#*.}"
if [ -z "${INSTANCE}" ] || [ "${SVCNAME}" = "ekeyd" ]; then
@@ -9,14 +9,14 @@ if [ -z "${INSTANCE}" ] || [ "${SVCNAME}" = "ekeyd" ]; then
fi
depend() {
- use udev
+ use udev ekey-ulusbd
}
start() {
ebegin "Starting EntropyKey daemon"
start-stop-daemon \
--start --pidfile "/var/run/${SVCNAME}.pid" \
- --exec /usr/sbin/ekeyd -- \
+ --exec /usr/libexec/ekeyd -- \
-f "/etc/entropykey/${INSTANCE}.conf" \
-p "/var/run/${SVCNAME}.pid"
eend $?
@@ -26,7 +26,7 @@ stop() {
ebegin "Stopping EntropyKey daemon"
start-stop-daemon \
--stop --pidfile "/var/run/${SVCNAME}.pid" \
- --exec /usr/sbin/ekeyd
+ --exec /usr/libexec/ekeyd
eend $?
}