slp (0:68f95e015346) slp (1573:7338e65f2666)
1#!/sbin/sh
2#
3# CDDL HEADER START
4#
5# The contents of this file are subject to the terms of the
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.
6# Common Development and Distribution License (the "License").
7# You may not use this file except in compliance 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#
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#
24# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
23# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
25# Use is subject to license terms.
26#
27#ident "%Z%%M% %I% %E% SMI"
28#
29# Service Method Support Script for the SLP service
30#
31# - operates a proxy for slpd which brings up the JVM to run slpd
32# when required by a client; this prevents keeping JVM's alive

--- 13 unchanged lines hidden (view full) ---

46case "$1" in
47'start')
48 # Start slpd proxy (as a fragile dependency, conf file must exist)
49 $SLPD_BIN -f $CONF >/dev/msglog 2>&1 &
50 ;;
51
52'stop')
53 # Kill the slpd proxy.
24# Use is subject to license terms.
25#
26#ident "%Z%%M% %I% %E% SMI"
27#
28# Service Method Support Script for the SLP service
29#
30# - operates a proxy for slpd which brings up the JVM to run slpd
31# when required by a client; this prevents keeping JVM's alive

--- 13 unchanged lines hidden (view full) ---

45case "$1" in
46'start')
47 # Start slpd proxy (as a fragile dependency, conf file must exist)
48 $SLPD_BIN -f $CONF >/dev/msglog 2>&1 &
49 ;;
50
51'stop')
52 # Kill the slpd proxy.
54 /usr/bin/pkill -x -u 0 -P 1 -z `/sbin/zonename` $SLPD
53 /usr/bin/pkill -x -u 0 -P 1 -z `smf_zonename` $SLPD
55
56 # If a configuration file exists signal a shutdown to the real slpd.
57 [ -f $CONF ] && {
58 $JAVA_BIN -classpath $CLASSPATH \
59 $MAIN_CLASS stop -f $CONF >/dev/msglog 2>&1 &
60
61 # Give the above slpd instance a chance to signal
62 # a shutdown to the real slpd instance. If after
63 # this time it has hung kill it.
64 sleep 5
65
66 # The pattern must not exceed 80 chars!
54
55 # If a configuration file exists signal a shutdown to the real slpd.
56 [ -f $CONF ] && {
57 $JAVA_BIN -classpath $CLASSPATH \
58 $MAIN_CLASS stop -f $CONF >/dev/msglog 2>&1 &
59
60 # Give the above slpd instance a chance to signal
61 # a shutdown to the real slpd instance. If after
62 # this time it has hung kill it.
63 sleep 5
64
65 # The pattern must not exceed 80 chars!
67 /usr/bin/pkill -x -f -u 0 -P 1,$$ -z `/sbin/zonename` \
66 /usr/bin/pkill -x -f -u 0 -P 1,$$ -z `smf_zonename` \
68 "${JAVA_BIN}.*-classpath ${CLASSPATH} .*"
69 }
70
71 # Kill the slpd proxy service contract
72 smf_kill_contract $2 TERM 1
73 [ $? -ne 0 ] && exit 1
74 ;;
75*)
76 echo "Usage: $0 { start | stop }"
77 exit 1
78 ;;
79esac
80exit 0
67 "${JAVA_BIN}.*-classpath ${CLASSPATH} .*"
68 }
69
70 # Kill the slpd proxy service contract
71 smf_kill_contract $2 TERM 1
72 [ $? -ne 0 ] && exit 1
73 ;;
74*)
75 echo "Usage: $0 { start | stop }"
76 exit 1
77 ;;
78esac
79exit 0