Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
computer:wibukey_properly_installed_in_debian [2010/05/02 21:49]
tdobes
computer:wibukey_properly_installed_in_debian [2011/01/14 20:46] (current)
tdobes add init.d script
Line 33: Line 33:
 # change owner for /​proc/​bus/​usb file: # change owner for /​proc/​bus/​usb file:
 SUBSYSTEM=="​usb",​ ATTRS{idVendor}=="​064f",​ ATTRS{idProduct}=="​0bd7",​ RUN+="/​bin/​chown wibukey /​proc/​bus/​usb/​$env{BUSNUM}/​$env{DEVNUM}"</​file>​ SUBSYSTEM=="​usb",​ ATTRS{idVendor}=="​064f",​ ATTRS{idProduct}=="​0bd7",​ RUN+="/​bin/​chown wibukey /​proc/​bus/​usb/​$env{BUSNUM}/​$env{DEVNUM}"</​file>​
 +  * ''/​etc/​init.d/​wibukey''​ looks like this:
 +<​file>​
 +#!/bin/sh
 +### BEGIN INIT INFO
 +# Provides: ​         wibukey
 +# Required-Start: ​   $remote_fs $network
 +# Required-Stop: ​    ​$remote_fs $network
 +# Default-Start: ​    2 3 4 5
 +# Default-Stop: ​     0 1 6
 +# Short-Description:​ Start the WibuKey server.
 +### END INIT INFO
 +
 +# Author: Tom Dobes <​tomdobes@purdue.edu>​
 +
 +PATH=/​sbin:/​usr/​sbin:/​bin:/​usr/​bin
 +DAEMON=/​opt/​wibukey/​WkSvLin
 +DAEMON_OPTS="​-d"​
 +NAME=wibukey
 +DESC="​WibuKey server"​
 +SCRIPTNAME=/​etc/​init.d/​$NAME
 +USER=wibukey
 +LD_LIBRARY_PATH="/​opt/​wibukey/​lib"​ ; export LD_LIBRARY_PATH
 +
 +test -x $DAEMON || exit 0
 +
 +set -e
 +
 +. /​lib/​lsb/​init-functions
 +
 +case "​$1"​ in
 +    start)
 +        log_daemon_msg "​Starting $DESC" $NAME
 +        if ! start-stop-daemon --start --quiet --oknodo \
 +            --chuid $USER --exec $DAEMON -- $DAEMON_OPTS
 +        then
 +            log_end_msg 1
 +        else
 +            log_end_msg 0
 +        fi
 +        ;;
 +    stop)
 +        log_daemon_msg "​Stopping $DESC" $NAME
 +        if start-stop-daemon --quiet --stop --oknodo --retry 30 --oknodo \
 +            --exec $DAEMON
 +        then
 +            log_end_msg 0
 +        else
 +            log_end_msg 1
 +        fi
 +        ;;
 +    restart|force-reload)
 +        $0 stop
 +        sleep 5
 +        $0 start
 +        ;;
 +    *)
 +        echo "​Usage:​ $SCRIPTNAME {start|stop|restart|force-reload}"​ >&2
 +        exit 1
 +        ;;
 +esac
 +
 +exit 0
 +</​file>​
computer/wibukey_properly_installed_in_debian.txt · Last modified: 2011/01/14 20:46 by tdobes
Recent changes RSS feed Driven by DokuWiki Valid XHTML 1.0 Valid CSS