components/trousers/tcsd.sh
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Mon, 07 Nov 2016 16:32:57 -0800
changeset 7257 779372532897
parent 6268 447a28fa6a83
permissions -rw-r--r--
Close of build 112.1.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1186
447cb9b2ff93 16391309 TrouSerS ERROR: max number of connections reached (10), new connection refused
Dan Anderson <dan.anderson@oracle.com>
parents: 743
diff changeset
     1
#! /usr/bin/sh
259
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
     2
#
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
     3
# CDDL HEADER START
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
     4
#
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
     5
# The contents of this file are subject to the terms of the
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
     6
# Common Development and Distribution License (the "License").
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
     7
# You may not use this file except in compliance with the License.
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
     8
#
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
     9
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    10
# or http://www.opensolaris.org/os/licensing.
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    11
# See the License for the specific language governing permissions
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    12
# and limitations under the License.
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    13
#
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    14
# When distributing Covered Code, include this CDDL HEADER in each
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    15
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    16
# If applicable, add the following below this CDDL HEADER, with the
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    17
# fields enclosed by brackets "[]" replaced with your own identifying
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    18
# information: Portions Copyright [yyyy] [name of copyright owner]
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    19
#
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    20
# CDDL HEADER END
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    21
#
5941
db8aa9865e9f 15776792 Upgrade TrouSerS TPM library to 0.3.13
Dan Anderson <dan.anderson@oracle.com>
parents: 1186
diff changeset
    22
db8aa9865e9f 15776792 Upgrade TrouSerS TPM library to 0.3.13
Dan Anderson <dan.anderson@oracle.com>
parents: 1186
diff changeset
    23
#
db8aa9865e9f 15776792 Upgrade TrouSerS TPM library to 0.3.13
Dan Anderson <dan.anderson@oracle.com>
parents: 1186
diff changeset
    24
# Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
259
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    25
#
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    26
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    27
. /lib/svc/share/smf_include.sh
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    28
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    29
# SMF_FMRI is the name of the target service. This allows multiple instances 
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    30
# to use the same script.
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    31
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    32
if [ -z "$SMF_FMRI" ]; then
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    33
	echo "SMF framework variables are not initialized."
1186
447cb9b2ff93 16391309 TrouSerS ERROR: max number of connections reached (10), new connection refused
Dan Anderson <dan.anderson@oracle.com>
parents: 743
diff changeset
    34
	exit $SMF_EXIT_ERR_NOSMF
259
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    35
fi
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    36
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    37
case "$1" in
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    38
'start')
1186
447cb9b2ff93 16391309 TrouSerS ERROR: max number of connections reached (10), new connection refused
Dan Anderson <dan.anderson@oracle.com>
parents: 743
diff changeset
    39
	if [ ! -r "/dev/tpm" ]; then
447cb9b2ff93 16391309 TrouSerS ERROR: max number of connections reached (10), new connection refused
Dan Anderson <dan.anderson@oracle.com>
parents: 743
diff changeset
    40
		smf_method_exit $SMF_EXIT_TEMP_DISABLE no_supported_hardware \
447cb9b2ff93 16391309 TrouSerS ERROR: max number of connections reached (10), new connection refused
Dan Anderson <dan.anderson@oracle.com>
parents: 743
diff changeset
    41
			"No TPM device /dev/tpm found"
447cb9b2ff93 16391309 TrouSerS ERROR: max number of connections reached (10), new connection refused
Dan Anderson <dan.anderson@oracle.com>
parents: 743
diff changeset
    42
	fi
259
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    43
1186
447cb9b2ff93 16391309 TrouSerS ERROR: max number of connections reached (10), new connection refused
Dan Anderson <dan.anderson@oracle.com>
parents: 743
diff changeset
    44
	echo /usr/lib/tcsd 
6268
447a28fa6a83 23618255 tcsd is coredumping on TPM enabled x86 systems
Dan Anderson <dan.anderson@oracle.com>
parents: 5941
diff changeset
    45
	TCSD_FOREGROUND=1 /usr/lib/tcsd &
259
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    46
	;;
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    47
1186
447cb9b2ff93 16391309 TrouSerS ERROR: max number of connections reached (10), new connection refused
Dan Anderson <dan.anderson@oracle.com>
parents: 743
diff changeset
    48
# Attribute exec=':kill' in manifest tcsd.xml stops the tcsd daemon.
259
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    49
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    50
*)
1186
447cb9b2ff93 16391309 TrouSerS ERROR: max number of connections reached (10), new connection refused
Dan Anderson <dan.anderson@oracle.com>
parents: 743
diff changeset
    51
	echo "Usage: $0 start"
259
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    52
	exit 1
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    53
	;;
1186
447cb9b2ff93 16391309 TrouSerS ERROR: max number of connections reached (10), new connection refused
Dan Anderson <dan.anderson@oracle.com>
parents: 743
diff changeset
    54
esac
259
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    55
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    56
exit $SMF_EXIT_OK