xref: /titanic_51/usr/src/cmd/utmpd/svc-utmpd (revision 0d435d6202242b0a06dc4bc41a1117591a9405f8)
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
66927f468Sdp# Common Development and Distribution License (the "License").
76927f468Sdp# 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#
227c478bd9Sstevel@tonic-gate#
23*92ba7109Seschrock# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate# Use is subject to license terms.
257c478bd9Sstevel@tonic-gate#
267c478bd9Sstevel@tonic-gate
277c478bd9Sstevel@tonic-gate. /lib/svc/share/smf_include.sh
287c478bd9Sstevel@tonic-gate
297c478bd9Sstevel@tonic-gate[ ! -x /usr/lib/utmpd ] && exit $SMF_EXIT_ERR_CONFIG
307c478bd9Sstevel@tonic-gate
317c478bd9Sstevel@tonic-gate# If a utmppipe exists, check for a utmpd process and exit
327c478bd9Sstevel@tonic-gate# if the daemon is already running.
337c478bd9Sstevel@tonic-gate
34*92ba7109Seschrockif [ -p /var/run/utmppipe ]; then
356927f468Sdp	if /usr/bin/pgrep -x -u 0 -z `smf_zonename` utmpd >/dev/null 2>&1; then
367c478bd9Sstevel@tonic-gate		echo "$0: utmpd is already running"
377c478bd9Sstevel@tonic-gate		exit 1
387c478bd9Sstevel@tonic-gate	fi
397c478bd9Sstevel@tonic-gatefi
407c478bd9Sstevel@tonic-gate
41*92ba7109Seschrock/usr/bin/rm -f /var/run/utmppipe
427c478bd9Sstevel@tonic-gate/usr/lib/utmpd &
43