Subversion Repositories configs

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 - 1
#!/bin/sh
2
#
3
# pcscd        Starts the pcscd Daemon
4
#
5
# chkconfig:   345 27 88
6
# description: The PC/SC smart card daemon is a resource manager for the \
7
#              PC/SC lite and Musclecard frameworks.  It coordinates \
8
#              communications with smart card readers, smart cards, and \
9
#              cryptographic tokens that are connected to the system.
10
#
11
# processname: pcscd
12
# config:      /etc/reader.conf
13
#
14
### BEGIN INIT INFO
15
# Provides: pcscd
16
# Required-Start: $local_fs $remote_fs $syslog
17
# Required-Stop: $local_fs $remote_fs $syslog
18
# Should-Start: udev haldaemon openct
19
# Should-Stop: udev haldaemon openct
20
# Default-Start: 3 4 5
21
# Default-Stop: 0 1 6
22
# Short-Description: Daemon to access a smart card using PC/SC
23
# Description: The PC/SC smart card daemon is a resource manager for the
24
#              PC/SC lite and Musclecard frameworks.  It coordinates
25
#              communications with smart card readers, smart cards, and
26
#              cryptographic tokens that are connected to the system.
27
### END INIT INFO
28
#
29
# Note!  pcscd should be started after pcmcia, and shut down before it
30
# for smooth experience with PCMCIA readers.
31
 
32
. /etc/init.d/functions
33
 
34
umask 077
35
 
36
exec=/usr/sbin/pcscd
37
prog=$(basename $exec)
38
lockfile=/var/lock/subsys/$prog
39
PCSCD_OPTIONS=
40
 
41
# Source config
42
if [ -f /etc/sysconfig/pcscd ] ; then
43
    . /etc/sysconfig/pcscd
44
fi
45
 
46
start() {
47
    echo -n $"Starting PC/SC smart card daemon ($prog): "
48
    /usr/sbin/update-reader.conf && daemon $prog $PCSCD_OPTIONS
49
    retval=$?
50
    echo
51
    [ $retval -eq 0 ] && touch $lockfile
52
    return $retval
53
}
54
stop() {
55
    echo -n $"Stopping PC/SC smart card daemon ($prog): "
56
    killproc $prog
57
    retval=$?
58
    echo
59
    [ $retval -eq 0 ] && rm -f $lockfile
60
    return $retval
61
}
62
restart() {
63
    stop
64
    start
65
}
66
 
67
 
68
case "$1" in
69
    start|stop|restart)
70
        $1
71
        ;;
72
    reload|force-reload)
73
        restart
74
        ;;
75
    status)
76
        status $prog
77
        ;;
78
    condrestart|try-restart)
79
        [ ! -f $lockfile ] || restart
80
        ;;
81
    *)
82
        echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
83
        exit 2
84
esac