packages/common_files/proc.smf_remove
author Niveditha Rau <Niveditha.Rau@Sun.COM>
Mon, 15 Feb 2010 16:34:06 -0800
changeset 903 c6b29bba4433
parent 214 dea2a0e2c5bf
child 907 3c35d611cdaa
permissions -rw-r--r--
6924667 "Xorg -configure" core dump on Ultra45 - X_133
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
214
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     1
#
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     2
# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     3
#
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     4
# Permission is hereby granted, free of charge, to any person obtaining a
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     5
# copy of this software and associated documentation files (the
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     6
# "Software"), to deal in the Software without restriction, including
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     7
# without limitation the rights to use, copy, modify, merge, publish,
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     8
# distribute, and/or sell copies of the Software, and to permit persons
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     9
# to whom the Software is furnished to do so, provided that the above
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    10
# copyright notice(s) and this permission notice appear in all copies of
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    11
# the Software and that both the above copyright notice(s) and this
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    12
# permission notice appear in supporting documentation.
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    13
#
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    14
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    15
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    16
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    17
# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    18
# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    19
# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    20
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    21
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    22
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    23
#
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    24
# Except as contained in this notice, the name of a copyright holder
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    25
# shall not be used in advertising or otherwise to promote the sale, use
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    26
# or other dealings in this Software without prior written authorization
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    27
# of the copyright holder.
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    28
#
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    29
# ident	"@(#)proc.smf_remove	1.3	07/09/04 SMI"
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    30
#
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    31
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    32
# proc.smf_remove -- common code for smf upgrade conditions
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    33
#
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    34
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    35
# Delete a previous manifest for this service and remove its services
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    36
smf_delete_manifest() {
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    37
	manifest=$1
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    38
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    39
	[ -f  $BASEDIR/$manifest ] || return 0;
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    40
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    41
	cat >> $BASEDIR/var/svc/profile/upgrade <<-EOF
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    42
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    43
	ENTITIES=\`svccfg inventory $manifest\`
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    44
	for fmri in \$ENTITIES; do
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    45
		svccfg delete \$fmri
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    46
	done
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    47
	rm $manifest
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    48
	EOF
dea2a0e2c5bf 6598247 open source SUNWmisc subdir of X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    49
}