Subversion Repositories configs

Rev

Rev 4 | Details | Compare with Previous | 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
34 - 39
socket=/var/run/pcscd.comm
40
mapfile=/var/run/pcscd.pub
4 - 41
PCSCD_OPTIONS=
42
 
43
# Source config
44
if [ -f /etc/sysconfig/pcscd ] ; then
45
    . /etc/sysconfig/pcscd
46
fi
47
 
48
start() {
49
    echo -n $"Starting PC/SC smart card daemon ($prog): "
50
    /usr/sbin/update-reader.conf && daemon $prog $PCSCD_OPTIONS
51
    retval=$?
52
    echo
53
    [ $retval -eq 0 ] && touch $lockfile
54
    return $retval
55
}
56
stop() {
57
    echo -n $"Stopping PC/SC smart card daemon ($prog): "
58
    killproc $prog
59
    retval=$?
60
    echo
61
    [ $retval -eq 0 ] && rm -f $lockfile
34 - 62
    rm -f $socket $mapfile
4 - 63
    return $retval
64
}
65
restart() {
66
    stop
67
    start
68
}
69
 
70
 
71
case "$1" in
72
    start|stop|restart)
73
        $1
74
        ;;
75
    reload|force-reload)
76
        restart
77
        ;;
78
    status)
79
        status $prog
80
        ;;
81
    condrestart|try-restart)
82
        [ ! -f $lockfile ] || restart
83
        ;;
84
    *)
85
        echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
86
        exit 2
87
esac