]>
Commit | Line | Data |
---|---|---|
f588025c JB |
1 | #!/bin/sh |
2 | # | |
3 | # pcscd PC/SC Smartcard daemon | |
4 | # | |
ab856a2b | 5 | # chkconfig: 2345 12 88 |
f588025c | 6 | # |
34b152c0 JB |
7 | # description: The PC/SC smart card daemon is a resource manager for the \ |
8 | # PC/SC lite and Musclecard frameworks. It coordinates \ | |
9 | # communications with smart card readers, smart cards, and \ | |
10 | # cryptographic tokens that are connected to the system. | |
11 | # | |
12 | # processname: pcscd | |
13 | # config: /etc/reader.conf | |
f588025c JB |
14 | # |
15 | # $Id$ | |
16 | ||
17 | ||
18 | # Source function library | |
19 | . /etc/rc.d/init.d/functions | |
20 | ||
34b152c0 JB |
21 | umask 077 |
22 | ||
f588025c JB |
23 | # Set defaults |
24 | LOGGING="yes" | |
25 | ||
26 | # Get service config - may override defaults | |
27 | [ -f /etc/sysconfig/pcscd ] && . /etc/sysconfig/pcscd | |
28 | ||
29 | if is_yes "${LOGGING}"; then | |
34b152c0 | 30 | LOGOPT="-d" |
f588025c JB |
31 | else |
32 | LOGOPT="" | |
33 | fi | |
34 | ||
bd7842e0 | 35 | RETVAL=0 |
f588025c JB |
36 | # See how we were called. |
37 | case "$1" in | |
38 | start) | |
39 | # Check if the service is already running? | |
40 | if [ ! -f /var/lock/subsys/pcscd ]; then | |
f588025c | 41 | msg_starting pcscd |
34b152c0 | 42 | /usr/sbin/update-reader.conf && daemon pcscd $LOGOPT |
f588025c JB |
43 | RETVAL=$? |
44 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pcscd | |
45 | else | |
f588025c | 46 | msg_already_running pcscd |
f588025c | 47 | fi |
ab856a2b | 48 | ;; |
f588025c | 49 | stop) |
ab856a2b | 50 | # Stop daemons. |
f588025c JB |
51 | if [ -f /var/lock/subsys/pcscd ]; then |
52 | msg_stopping pcscd | |
53 | killproc pcscd | |
f588025c JB |
54 | rm -f /var/lock/subsys/pcscd |
55 | else | |
f588025c | 56 | msg_not_running pcscd |
2638beea | 57 | fi |
ab856a2b | 58 | ;; |
bd7842e0 | 59 | restart|force-reload) |
f588025c | 60 | # pcscd doesn't support reloading on HUP |
ab856a2b | 61 | $0 stop |
f588025c | 62 | $0 start |
bd7842e0 | 63 | exit $? |
ab856a2b | 64 | ;; |
f588025c JB |
65 | status) |
66 | status pcscd | |
bd7842e0 | 67 | exit $? |
ab856a2b | 68 | ;; |
f588025c | 69 | *) |
bd7842e0 | 70 | msg_usage "$0 {start|stop|restart|force-reload|status}" |
71 | exit 3 | |
f588025c JB |
72 | esac |
73 | ||
74 | exit $RETVAL | |
75 | ||
76 | # This must be last line ! | |
77 | # vi:syntax=sh:tw=78:ts=8:sw=4 |