components/pcsc-lite/Solaris/svc-pcscd
author Ivo Raisr <ivo.raisr@oracle.com>
Mon, 08 Aug 2016 11:58:51 -0700
branchs11u3-sru
changeset 6628 6c50cb7e9ba0
parent 6361 2a305758f590
permissions -rw-r--r--
24392172 pcscd should reside in /usr/lib
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6361
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
     1
#!/sbin/sh
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
     2
#
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
     3
# CDDL HEADER START
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
     4
#
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
     5
# The contents of this file are subject to the terms of the
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
     6
# Common Development and Distribution License (the "License").
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
     7
# You may not use this file except in compliance with the License.
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
     8
#
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
     9
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    10
# or http://www.opensolaris.org/os/licensing.
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    11
# See the License for the specific language governing permissions
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    12
# and limitations under the License.
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    13
#
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    14
# When distributing Covered Code, include this CDDL HEADER in each
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    15
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    16
# If applicable, add the following below this CDDL HEADER, with the
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    17
# fields enclosed by brackets "[]" replaced with your own identifying
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    18
# information: Portions Copyright [yyyy] [name of copyright owner]
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    19
#
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    20
# CDDL HEADER END
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    21
#
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    22
#
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    23
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    24
#
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    25
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    26
. /lib/svc/share/smf_include.sh
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    27
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    28
NAME=pcscd
6628
6c50cb7e9ba0 24392172 pcscd should reside in /usr/lib
Ivo Raisr <ivo.raisr@oracle.com>
parents: 6361
diff changeset
    29
DAEMON=/usr/lib/$NAME
6361
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    30
PIDFILE=$SMF_SYSVOL_FS/$NAME.pid
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    31
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    32
# exit if the server daemon is not installed
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    33
[ -x "$DAEMON" ] || exit 0
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    34
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    35
case "$1" in
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    36
'start')
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    37
	$DAEMON >/dev/null 2>&1 &
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    38
	;;
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    39
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    40
# attribute exec=':kill' in manifest pcscd.xml stops the pcscd daemon.
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    41
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    42
'restart')
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    43
	if [ -f "$PIDFILE" ]; then
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    44
		/usr/bin/kill -HUP `/usr/bin/cat $PIDFILE`
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    45
	fi
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    46
	;;
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    47
*)
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    48
	echo "Usage: $0 {start|restart}" 
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    49
	exit 1
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    50
	;;
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    51
esac
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    52
exit $?
2a305758f590 PSARC/2016/217 Smartcard Reintroduction
Jan Parcel <jan.parcel@oracle.com>
parents:
diff changeset
    53