components/trousers/tcsd.sh
author Dan Anderson <dan.anderson@oracle.com>
Fri, 01 Mar 2013 11:12:29 -0800
changeset 1186 447cb9b2ff93
parent 743 ac51639ccac1
child 5941 db8aa9865e9f
permissions -rw-r--r--
16391309 TrouSerS ERROR: max number of connections reached (10), new connection refused
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
#
1186
447cb9b2ff93 16391309 TrouSerS ERROR: max number of connections reached (10), new connection refused
Dan Anderson <dan.anderson@oracle.com>
parents: 743
diff changeset
    22
# Copyright (c) 2008, 2013, 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
    23
#
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    24
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    25
. /lib/svc/share/smf_include.sh
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
# 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
    28
# to use the same script.
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    29
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    30
if [ -z "$SMF_FMRI" ]; then
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    31
	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
    32
	exit $SMF_EXIT_ERR_NOSMF
259
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    33
fi
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    34
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    35
case "$1" in
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    36
'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
    37
	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
    38
		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
    39
			"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
    40
	fi
259
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    41
1186
447cb9b2ff93 16391309 TrouSerS ERROR: max number of connections reached (10), new connection refused
Dan Anderson <dan.anderson@oracle.com>
parents: 743
diff changeset
    42
	echo /usr/lib/tcsd 
447cb9b2ff93 16391309 TrouSerS ERROR: max number of connections reached (10), new connection refused
Dan Anderson <dan.anderson@oracle.com>
parents: 743
diff changeset
    43
	/usr/lib/tcsd >/dev/null 2>&1 &
259
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    44
	;;
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    45
1186
447cb9b2ff93 16391309 TrouSerS ERROR: max number of connections reached (10), new connection refused
Dan Anderson <dan.anderson@oracle.com>
parents: 743
diff changeset
    46
# 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
    47
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    48
*)
1186
447cb9b2ff93 16391309 TrouSerS ERROR: max number of connections reached (10), new connection refused
Dan Anderson <dan.anderson@oracle.com>
parents: 743
diff changeset
    49
	echo "Usage: $0 start"
259
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    50
	exit 1
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    51
	;;
1186
447cb9b2ff93 16391309 TrouSerS ERROR: max number of connections reached (10), new connection refused
Dan Anderson <dan.anderson@oracle.com>
parents: 743
diff changeset
    52
esac
259
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    53
520697a05dde 7045320 Move trousers from SFW to Userland
Wyllys Ingersoll <Wyllys.Ingersoll@Oracle.COM>
parents:
diff changeset
    54
exit $SMF_EXIT_OK