xref: /illumos-gate/usr/src/cmd/svc/milestone/make-console-login-xml (revision aecfc01d1bad84e66649703f7fc2926ef70b34ba)
17c478bd9Sstevel@tonic-gate#!/sbin/sh
27c478bd9Sstevel@tonic-gate#
37c478bd9Sstevel@tonic-gate# CDDL HEADER START
47c478bd9Sstevel@tonic-gate#
57c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
6fea9cb91Slq150181# Common Development and Distribution License (the "License").
7fea9cb91Slq150181# You may not use this file except in compliance with the License.
87c478bd9Sstevel@tonic-gate#
97c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate# and limitations under the License.
137c478bd9Sstevel@tonic-gate#
147c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate#
207c478bd9Sstevel@tonic-gate# CDDL HEADER END
217c478bd9Sstevel@tonic-gate#
22fea9cb91Slq150181
237c478bd9Sstevel@tonic-gate#
24*aecfc01dSrui zang - Sun Microsystems - Beijing China# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
257c478bd9Sstevel@tonic-gate# Use is subject to license terms.
267c478bd9Sstevel@tonic-gate#
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gatecat >console-login.xml <<EOF
297c478bd9Sstevel@tonic-gate<?xml version="1.0"?>
307c478bd9Sstevel@tonic-gate<!--
31fea9cb91Slq150181	Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
327c478bd9Sstevel@tonic-gate	Use is subject to license terms.
337c478bd9Sstevel@tonic-gate
347c478bd9Sstevel@tonic-gate	NOTE:  This service manifest is not editable; its contents will
357c478bd9Sstevel@tonic-gate	be overwritten by package or patch operations, including
367c478bd9Sstevel@tonic-gate	operating system upgrade.  Make customizations in a different
377c478bd9Sstevel@tonic-gate	file.
387c478bd9Sstevel@tonic-gate-->
397c478bd9Sstevel@tonic-gate
407c478bd9Sstevel@tonic-gate<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
417c478bd9Sstevel@tonic-gate
427c478bd9Sstevel@tonic-gate<service_bundle type='manifest' name='SUNWcsr:console'>
437c478bd9Sstevel@tonic-gate
447c478bd9Sstevel@tonic-gate<service
457c478bd9Sstevel@tonic-gate	name='system/console-login'
467c478bd9Sstevel@tonic-gate	type='service'
477c478bd9Sstevel@tonic-gate	version='1'>
487c478bd9Sstevel@tonic-gate
497c478bd9Sstevel@tonic-gate	<dependency
507c478bd9Sstevel@tonic-gate		name='fs'
517c478bd9Sstevel@tonic-gate		grouping='require_all'
527c478bd9Sstevel@tonic-gate		restart_on='none'
537c478bd9Sstevel@tonic-gate		type='service'>
547c478bd9Sstevel@tonic-gate		<service_fmri value='svc:/system/filesystem/minimal' />
557c478bd9Sstevel@tonic-gate	</dependency>
567c478bd9Sstevel@tonic-gate
577c478bd9Sstevel@tonic-gate	<dependency
587c478bd9Sstevel@tonic-gate		name='identity'
597c478bd9Sstevel@tonic-gate		grouping='require_all'
607c478bd9Sstevel@tonic-gate		restart_on='none'
617c478bd9Sstevel@tonic-gate		type='service'>
627c478bd9Sstevel@tonic-gate		<service_fmri value='svc:/system/identity:node' />
637c478bd9Sstevel@tonic-gate	</dependency>
647c478bd9Sstevel@tonic-gate
657c478bd9Sstevel@tonic-gate	<dependency
667c478bd9Sstevel@tonic-gate		name='utmpx'
677c478bd9Sstevel@tonic-gate		grouping='require_all'
687c478bd9Sstevel@tonic-gate		restart_on='none'
697c478bd9Sstevel@tonic-gate		type='service'>
707c478bd9Sstevel@tonic-gate		<service_fmri value='svc:/system/utmp:default' />
717c478bd9Sstevel@tonic-gate	</dependency>
727c478bd9Sstevel@tonic-gate
737c478bd9Sstevel@tonic-gate	<!-- Note that console-login should be dependent on any services
747c478bd9Sstevel@tonic-gate	     that may need to use the console. This requirement can be met
757c478bd9Sstevel@tonic-gate	     by establishing a dependency on milestone/sysconfig which,
767c478bd9Sstevel@tonic-gate	     among other things, collects such dependencies.
777c478bd9Sstevel@tonic-gate	-->
787c478bd9Sstevel@tonic-gate	<dependency
797c478bd9Sstevel@tonic-gate		name='sysconfig'
807c478bd9Sstevel@tonic-gate		grouping='require_all'
817c478bd9Sstevel@tonic-gate		restart_on='none'
827c478bd9Sstevel@tonic-gate		type='service'>
837c478bd9Sstevel@tonic-gate		<service_fmri value='svc:/milestone/sysconfig' />
847c478bd9Sstevel@tonic-gate	</dependency>
857c478bd9Sstevel@tonic-gate
867c478bd9Sstevel@tonic-gate	<exec_method
877c478bd9Sstevel@tonic-gate		type='method'
887c478bd9Sstevel@tonic-gate		name='start'
89*aecfc01dSrui zang - Sun Microsystems - Beijing China		exec='/lib/svc/method/console-login %i'
90*aecfc01dSrui zang - Sun Microsystems - Beijing China		timeout_seconds='0'>
91*aecfc01dSrui zang - Sun Microsystems - Beijing China                <method_context>
92*aecfc01dSrui zang - Sun Microsystems - Beijing China                        <method_credential user='root' group='root' />
93*aecfc01dSrui zang - Sun Microsystems - Beijing China                </method_context>
94*aecfc01dSrui zang - Sun Microsystems - Beijing China        </exec_method>
957c478bd9Sstevel@tonic-gate
967c478bd9Sstevel@tonic-gate	<exec_method
977c478bd9Sstevel@tonic-gate		type='method'
987c478bd9Sstevel@tonic-gate		name='stop'
997c478bd9Sstevel@tonic-gate		exec=':kill -9'
100*aecfc01dSrui zang - Sun Microsystems - Beijing China		timeout_seconds='3'>
101*aecfc01dSrui zang - Sun Microsystems - Beijing China                <method_context>
102*aecfc01dSrui zang - Sun Microsystems - Beijing China                        <method_credential user='root' group='root' />
103*aecfc01dSrui zang - Sun Microsystems - Beijing China                </method_context>
104*aecfc01dSrui zang - Sun Microsystems - Beijing China        </exec_method>
105*aecfc01dSrui zang - Sun Microsystems - Beijing China
1067c478bd9Sstevel@tonic-gate
1077c478bd9Sstevel@tonic-gate	<property_group name='startd' type='framework'>
1087c478bd9Sstevel@tonic-gate		<propval name='duration' type='astring' value='child' />
1097c478bd9Sstevel@tonic-gate		<propval name='ignore_error' type='astring'
1107c478bd9Sstevel@tonic-gate			value='core,signal' />
1117c478bd9Sstevel@tonic-gate		<propval name='utmpx_prefix' type='astring' value='co' />
1127c478bd9Sstevel@tonic-gate	</property_group>
1137c478bd9Sstevel@tonic-gate
114*aecfc01dSrui zang - Sun Microsystems - Beijing China	<property_group name='general' type='framework'>
115*aecfc01dSrui zang - Sun Microsystems - Beijing China		<propval name='action_authorization' type='astring'
116*aecfc01dSrui zang - Sun Microsystems - Beijing China			value='solaris.smf.manage.vt' />
117*aecfc01dSrui zang - Sun Microsystems - Beijing China		<propval name='value_authorization' type='astring'
118*aecfc01dSrui zang - Sun Microsystems - Beijing China			value='solaris.smf.manage.vt' />
119*aecfc01dSrui zang - Sun Microsystems - Beijing China	</property_group>
120*aecfc01dSrui zang - Sun Microsystems - Beijing China
121*aecfc01dSrui zang - Sun Microsystems - Beijing China	<!-- these are passed to ttymon in the method script.
122*aecfc01dSrui zang - Sun Microsystems - Beijing China	     note that value_authorization is not passed to ttymon
123*aecfc01dSrui zang - Sun Microsystems - Beijing China	     and it's for smf_security(5).
124*aecfc01dSrui zang - Sun Microsystems - Beijing China	-->
1257c478bd9Sstevel@tonic-gate	<property_group name='ttymon' type='application'>
126*aecfc01dSrui zang - Sun Microsystems - Beijing China		<propval name='value_authorization' type='astring'
127*aecfc01dSrui zang - Sun Microsystems - Beijing China			value='solaris.smf.value.vt' />
1287c478bd9Sstevel@tonic-gate		<propval name='device' type='astring' value='/dev/console' />
1297c478bd9Sstevel@tonic-gate		<propval name='label' type='astring' value='console' />
1307c478bd9Sstevel@tonic-gate		<propval name='timeout' type='count' value='0' />
1317c478bd9Sstevel@tonic-gate		<propval name='nohangup' type='boolean' value='true' />
1327c478bd9Sstevel@tonic-gate		<propval name='modules' type='astring'
1337c478bd9Sstevel@tonic-gate		    value='ldterm,ttcompat' />
1347c478bd9Sstevel@tonic-gate		<propval name='prompt' type='astring'
1357c478bd9Sstevel@tonic-gate		   value='\`uname -n\` console login:' />
1367c478bd9Sstevel@tonic-gate		<propval name='terminal_type' type='astring'
137fea9cb91Slq150181		     value='' />
1387c478bd9Sstevel@tonic-gate	</property_group>
1397c478bd9Sstevel@tonic-gate
140*aecfc01dSrui zang - Sun Microsystems - Beijing China
141*aecfc01dSrui zang - Sun Microsystems - Beijing China<instance name='default' enabled='true'>
142*aecfc01dSrui zang - Sun Microsystems - Beijing China</instance>
143*aecfc01dSrui zang - Sun Microsystems - Beijing China
144*aecfc01dSrui zang - Sun Microsystems - Beijing ChinaEOF
145*aecfc01dSrui zang - Sun Microsystems - Beijing China
146*aecfc01dSrui zang - Sun Microsystems - Beijing China# Note that this script file is normally parsed during build by sh(1).
147*aecfc01dSrui zang - Sun Microsystems - Beijing China# When the parser encounters an EOF token (like the one above), it
148*aecfc01dSrui zang - Sun Microsystems - Beijing China# will fork off and pipe all the text after the EOF above to the shell
149*aecfc01dSrui zang - Sun Microsystems - Beijing China# for execution.
150*aecfc01dSrui zang - Sun Microsystems - Beijing China#
151*aecfc01dSrui zang - Sun Microsystems - Beijing China# one system console (/dev/console) plus five virtual consoles
152*aecfc01dSrui zang - Sun Microsystems - Beijing China# (/dev/vt/#, # is from 2 to 6).
153*aecfc01dSrui zang - Sun Microsystems - Beijing China
154*aecfc01dSrui zang - Sun Microsystems - Beijing Chinafor num in 2 3 4 5 6; do
155*aecfc01dSrui zang - Sun Microsystems - Beijing China	cat >>console-login.xml <<EOF
156*aecfc01dSrui zang - Sun Microsystems - Beijing China
157*aecfc01dSrui zang - Sun Microsystems - Beijing China<instance name='vt$num' enabled='false'>
158*aecfc01dSrui zang - Sun Microsystems - Beijing China
159*aecfc01dSrui zang - Sun Microsystems - Beijing China	<dependency
160*aecfc01dSrui zang - Sun Microsystems - Beijing China		name='system-console'
161*aecfc01dSrui zang - Sun Microsystems - Beijing China		grouping='require_all'
162*aecfc01dSrui zang - Sun Microsystems - Beijing China		restart_on='none'
163*aecfc01dSrui zang - Sun Microsystems - Beijing China		type='service'>
164*aecfc01dSrui zang - Sun Microsystems - Beijing China		<service_fmri value='svc:/system/console-login:default' />
165*aecfc01dSrui zang - Sun Microsystems - Beijing China	</dependency>
166*aecfc01dSrui zang - Sun Microsystems - Beijing China
167*aecfc01dSrui zang - Sun Microsystems - Beijing China	<dependency
168*aecfc01dSrui zang - Sun Microsystems - Beijing China		name='vtdaemon'
169*aecfc01dSrui zang - Sun Microsystems - Beijing China		grouping='require_all'
170*aecfc01dSrui zang - Sun Microsystems - Beijing China		restart_on='none'
171*aecfc01dSrui zang - Sun Microsystems - Beijing China		type='service'>
172*aecfc01dSrui zang - Sun Microsystems - Beijing China		<service_fmri value='svc:/system/vtdaemon:default' />
173*aecfc01dSrui zang - Sun Microsystems - Beijing China	</dependency>
174*aecfc01dSrui zang - Sun Microsystems - Beijing China
175*aecfc01dSrui zang - Sun Microsystems - Beijing China        <!-- these are passed to ttymon in the method script -->
176*aecfc01dSrui zang - Sun Microsystems - Beijing China        <property_group name='ttymon' type='application'>
177*aecfc01dSrui zang - Sun Microsystems - Beijing China		<propval name='value_authorization' type='astring'
178*aecfc01dSrui zang - Sun Microsystems - Beijing China			value='solaris.smf.value.vt' />
179*aecfc01dSrui zang - Sun Microsystems - Beijing China		<propval name='device' type='astring' value='/dev/vt/$num' />
180*aecfc01dSrui zang - Sun Microsystems - Beijing China		<propval name='label' type='astring' value='console' />
181*aecfc01dSrui zang - Sun Microsystems - Beijing China		<propval name='timeout' type='count' value='0' />
182*aecfc01dSrui zang - Sun Microsystems - Beijing China		<propval name='nohangup' type='boolean' value='true' />
183*aecfc01dSrui zang - Sun Microsystems - Beijing China		<propval name='modules' type='astring'
184*aecfc01dSrui zang - Sun Microsystems - Beijing China			value='ldterm,ttcompat' />
185*aecfc01dSrui zang - Sun Microsystems - Beijing China		<propval name='prompt' type='astring'
186*aecfc01dSrui zang - Sun Microsystems - Beijing China			value='\`uname -n\` vt$num login:' />
187*aecfc01dSrui zang - Sun Microsystems - Beijing China		<propval name='terminal_type' type='astring'
188*aecfc01dSrui zang - Sun Microsystems - Beijing China			value='' />
189*aecfc01dSrui zang - Sun Microsystems - Beijing China	</property_group>
190*aecfc01dSrui zang - Sun Microsystems - Beijing China
191*aecfc01dSrui zang - Sun Microsystems - Beijing China</instance>
192*aecfc01dSrui zang - Sun Microsystems - Beijing China
193*aecfc01dSrui zang - Sun Microsystems - Beijing ChinaEOF
194*aecfc01dSrui zang - Sun Microsystems - Beijing Chinadone
195*aecfc01dSrui zang - Sun Microsystems - Beijing China
196*aecfc01dSrui zang - Sun Microsystems - Beijing Chinacat >>console-login.xml <<EOF
197*aecfc01dSrui zang - Sun Microsystems - Beijing China
1987c478bd9Sstevel@tonic-gate	<stability value='Evolving' />
1997c478bd9Sstevel@tonic-gate
2007c478bd9Sstevel@tonic-gate	<template>
2017c478bd9Sstevel@tonic-gate		<common_name>
2027c478bd9Sstevel@tonic-gate			<loctext xml:lang='C'>
2037c478bd9Sstevel@tonic-gateConsole login
2047c478bd9Sstevel@tonic-gate			</loctext>
2057c478bd9Sstevel@tonic-gate		</common_name>
2067c478bd9Sstevel@tonic-gate		<documentation>
2077c478bd9Sstevel@tonic-gate			<manpage title='ttymon' section='1M'
2087c478bd9Sstevel@tonic-gate				manpath='/usr/share/man' />
2097c478bd9Sstevel@tonic-gate		</documentation>
2107c478bd9Sstevel@tonic-gate	</template>
2117c478bd9Sstevel@tonic-gate</service>
2127c478bd9Sstevel@tonic-gate
2137c478bd9Sstevel@tonic-gate</service_bundle>
2147c478bd9Sstevel@tonic-gateEOF
215