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 (the "License"). 7# You may not use this file except in compliance with the License. 8# 9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10# or http://www.opensolaris.org/os/licensing. 11# See the License for the specific language governing permissions 12# and limitations under the License. 13# 14# When distributing Covered Code, include this CDDL HEADER in each 15# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16# If applicable, add the following below this CDDL HEADER, with the 17# fields enclosed by brackets "[]" replaced with your own identifying 18# information: Portions Copyright [yyyy] [name of copyright owner] 19# 20# CDDL HEADER END 21# 22 23# 24# Copyright 2008 Sun Microsystems, Inc. All rights reserved. 25# Use is subject to license terms. 26# 27 28cat >console-login.xml <<EOF 29<?xml version="1.0"?> 30<!-- 31 Copyright 2006 Sun Microsystems, Inc. All rights reserved. 32 Use is subject to license terms. 33 34 NOTE: This service manifest is not editable; its contents will 35 be overwritten by package or patch operations, including 36 operating system upgrade. Make customizations in a different 37 file. 38--> 39 40<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> 41 42<service_bundle type='manifest' name='SUNWcsr:console'> 43 44<service 45 name='system/console-login' 46 type='service' 47 version='1'> 48 49 <dependency 50 name='fs' 51 grouping='require_all' 52 restart_on='none' 53 type='service'> 54 <service_fmri value='svc:/system/filesystem/minimal' /> 55 </dependency> 56 57 <dependency 58 name='identity' 59 grouping='require_all' 60 restart_on='none' 61 type='service'> 62 <service_fmri value='svc:/system/identity:node' /> 63 </dependency> 64 65 <dependency 66 name='utmpx' 67 grouping='require_all' 68 restart_on='none' 69 type='service'> 70 <service_fmri value='svc:/system/utmp:default' /> 71 </dependency> 72 73 <!-- Note that console-login should be dependent on any services 74 that may need to use the console. This requirement can be met 75 by establishing a dependency on milestone/sysconfig which, 76 among other things, collects such dependencies. 77 --> 78 <dependency 79 name='sysconfig' 80 grouping='require_all' 81 restart_on='none' 82 type='service'> 83 <service_fmri value='svc:/milestone/sysconfig' /> 84 </dependency> 85 86 <exec_method 87 type='method' 88 name='start' 89 exec='/lib/svc/method/console-login %i' 90 timeout_seconds='0'> 91 <method_context> 92 <method_credential user='root' group='root' /> 93 </method_context> 94 </exec_method> 95 96 <exec_method 97 type='method' 98 name='stop' 99 exec=':kill -9' 100 timeout_seconds='3'> 101 <method_context> 102 <method_credential user='root' group='root' /> 103 </method_context> 104 </exec_method> 105 106 107 <property_group name='startd' type='framework'> 108 <propval name='duration' type='astring' value='child' /> 109 <propval name='ignore_error' type='astring' 110 value='core,signal' /> 111 <propval name='utmpx_prefix' type='astring' value='co' /> 112 </property_group> 113 114 <property_group name='general' type='framework'> 115 <propval name='action_authorization' type='astring' 116 value='solaris.smf.manage.vt' /> 117 <propval name='value_authorization' type='astring' 118 value='solaris.smf.manage.vt' /> 119 </property_group> 120 121 <!-- these are passed to ttymon in the method script. 122 note that value_authorization is not passed to ttymon 123 and it's for smf_security(5). 124 --> 125 <property_group name='ttymon' type='application'> 126 <propval name='value_authorization' type='astring' 127 value='solaris.smf.value.vt' /> 128 <propval name='device' type='astring' value='/dev/console' /> 129 <propval name='label' type='astring' value='console' /> 130 <propval name='timeout' type='count' value='0' /> 131 <propval name='nohangup' type='boolean' value='true' /> 132 <propval name='modules' type='astring' 133 value='ldterm,ttcompat' /> 134 <propval name='prompt' type='astring' 135 value='\`uname -n\` console login:' /> 136 <propval name='terminal_type' type='astring' 137 value='' /> 138 </property_group> 139 140 141<instance name='default' enabled='true'> 142</instance> 143 144EOF 145 146# Note that this script file is normally parsed during build by sh(1). 147# When the parser encounters an EOF token (like the one above), it 148# will fork off and pipe all the text after the EOF above to the shell 149# for execution. 150# 151# one system console (/dev/console) plus five virtual consoles 152# (/dev/vt/#, # is from 2 to 6). 153 154for num in 2 3 4 5 6; do 155 cat >>console-login.xml <<EOF 156 157<instance name='vt$num' enabled='false'> 158 159 <dependency 160 name='system-console' 161 grouping='require_all' 162 restart_on='none' 163 type='service'> 164 <service_fmri value='svc:/system/console-login:default' /> 165 </dependency> 166 167 <dependency 168 name='vtdaemon' 169 grouping='require_all' 170 restart_on='none' 171 type='service'> 172 <service_fmri value='svc:/system/vtdaemon:default' /> 173 </dependency> 174 175 <!-- these are passed to ttymon in the method script --> 176 <property_group name='ttymon' type='application'> 177 <propval name='value_authorization' type='astring' 178 value='solaris.smf.value.vt' /> 179 <propval name='device' type='astring' value='/dev/vt/$num' /> 180 <propval name='label' type='astring' value='console' /> 181 <propval name='timeout' type='count' value='0' /> 182 <propval name='nohangup' type='boolean' value='true' /> 183 <propval name='modules' type='astring' 184 value='ldterm,ttcompat' /> 185 <propval name='prompt' type='astring' 186 value='\`uname -n\` vt$num login:' /> 187 <propval name='terminal_type' type='astring' 188 value='' /> 189 </property_group> 190 191</instance> 192 193EOF 194done 195 196cat >>console-login.xml <<EOF 197 198 <stability value='Evolving' /> 199 200 <template> 201 <common_name> 202 <loctext xml:lang='C'> 203Console login 204 </loctext> 205 </common_name> 206 <documentation> 207 <manpage title='ttymon' section='1M' 208 manpath='/usr/share/man' /> 209 </documentation> 210 </template> 211</service> 212 213</service_bundle> 214EOF 215