6 # The contents of this file are subject to the terms of the
7 # Common Development and Distribution License (the "License").
8 # You may not use this file except in compliance with the License.
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.
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]
25 # Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
28 .
/lib
/svc
/share
/smf_include.sh
30 SAMBA_CONFIG
=/etc
/samba
/smb.conf
32 NSS_STRICT_NOFORK
=DISABLED
; export NSS_STRICT_NOFORK
34 # Check if given service is working properly
37 svc
:/network
/winbind
:*)
38 # It takes some time before winbind starts to really work
39 # This is infinite loop which will be killed after smf timeout
42 PING
=`/usr/bin/wbinfo --ping-dc 2>&1`
55 if [ ! -f "$SAMBA_CONFIG" ]; then
56 echo "Configuration file '$SAMBA_CONFIG' does not exist."
60 # Command to execute is found in second and further script arguments
66 # kill whole contract group
68 # first send TERM signal and wait 30 seconds
69 smf_kill_contract
$2 TERM
1 30
71 [ $ret -eq 1 ] && exit 1
73 # If there are still processes running, KILL them
74 if [ $ret -eq 2 ] ; then
75 smf_kill_contract
$2 KILL
1
81 $0 start <command to run>
82 $0 stop <contract number to kill>