1#!/sbin/sh 2# 3# CDDL HEADER START 4# 5# The contents of this file are subject to the terms of the 6# Common Development and Distribution License, Version 1.0 only 7# (the "License"). You may not use this file except in compliance 8# with the License. 9# 10# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 11# or http://www.opensolaris.org/os/licensing. 12# See the License for the specific language governing permissions 13# and limitations under the License. 14# 15# When distributing Covered Code, include this CDDL HEADER in each 16# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 17# If applicable, add the following below this CDDL HEADER, with the 18# fields enclosed by brackets "[]" replaced with your own identifying 19# information: Portions Copyright [yyyy] [name of copyright owner] 20# 21# CDDL HEADER END 22# 23# 24# Copyright 2004 Sun Microsystems, Inc. All rights reserved. 25# Use is subject to license terms. 26# 27#ident "%Z%%M% %I% %E% SMI" 28 29case "$MACH" in 30 sparc) 31 TTY_TYPE=sun 32 ;; 33 i386) 34 TTY_TYPE=sun-color 35 ;; 36 *) 37 echo "Unknown machine type $MACH" >&2 38 exit 1 39esac 40 41cat >console-login.xml <<EOF 42<?xml version="1.0"?> 43<!-- 44 Copyright 2004 Sun Microsystems, Inc. All rights reserved. 45 Use is subject to license terms. 46 47 ident "%Z%%M% %I% %E% SMI" 48 49 NOTE: This service manifest is not editable; its contents will 50 be overwritten by package or patch operations, including 51 operating system upgrade. Make customizations in a different 52 file. 53--> 54 55<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> 56 57<service_bundle type='manifest' name='SUNWcsr:console'> 58 59<service 60 name='system/console-login' 61 type='service' 62 version='1'> 63 64 <create_default_instance enabled='true' /> 65 66 <single_instance/> 67 68 <dependency 69 name='fs' 70 grouping='require_all' 71 restart_on='none' 72 type='service'> 73 <service_fmri value='svc:/system/filesystem/minimal' /> 74 </dependency> 75 76 <dependency 77 name='identity' 78 grouping='require_all' 79 restart_on='none' 80 type='service'> 81 <service_fmri value='svc:/system/identity:node' /> 82 </dependency> 83 84 <dependency 85 name='utmpx' 86 grouping='require_all' 87 restart_on='none' 88 type='service'> 89 <service_fmri value='svc:/system/utmp:default' /> 90 </dependency> 91 92 <!-- Note that console-login should be dependent on any services 93 that may need to use the console. This requirement can be met 94 by establishing a dependency on milestone/sysconfig which, 95 among other things, collects such dependencies. 96 --> 97 <dependency 98 name='sysconfig' 99 grouping='require_all' 100 restart_on='none' 101 type='service'> 102 <service_fmri value='svc:/milestone/sysconfig' /> 103 </dependency> 104 105 <exec_method 106 type='method' 107 name='start' 108 exec='/lib/svc/method/console-login' 109 timeout_seconds='0' /> 110 111 <exec_method 112 type='method' 113 name='stop' 114 exec=':kill -9' 115 timeout_seconds='3' /> 116 117 <property_group name='startd' type='framework'> 118 <propval name='duration' type='astring' value='child' /> 119 <propval name='ignore_error' type='astring' 120 value='core,signal' /> 121 <propval name='utmpx_prefix' type='astring' value='co' /> 122 </property_group> 123 124 <!-- these are passed to ttymon in the method script --> 125 <property_group name='ttymon' type='application'> 126 <propval name='device' type='astring' value='/dev/console' /> 127 <propval name='label' type='astring' value='console' /> 128 <propval name='timeout' type='count' value='0' /> 129 <propval name='nohangup' type='boolean' value='true' /> 130 <propval name='modules' type='astring' 131 value='ldterm,ttcompat' /> 132 <propval name='prompt' type='astring' 133 value='\`uname -n\` console login:' /> 134 <propval name='terminal_type' type='astring' 135 value='$TTY_TYPE' /> 136 </property_group> 137 138 <stability value='Evolving' /> 139 140 <template> 141 <common_name> 142 <loctext xml:lang='C'> 143Console login 144 </loctext> 145 </common_name> 146 <documentation> 147 <manpage title='ttymon' section='1M' 148 manpath='/usr/share/man' /> 149 </documentation> 150 </template> 151</service> 152 153</service_bundle> 154EOF 155