svc-legacy-routing (a192e900) | svc-legacy-routing (f4b3ec61) |
---|---|
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 (the "License"). 7# You may not use this file except in compliance with the License. 8# --- 6 unchanged lines hidden (view full) --- 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# | 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 (the "License"). 7# You may not use this file except in compliance with the License. 8# --- 6 unchanged lines hidden (view full) --- 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# |
23# Copyright 2006 Sun Microsystems, Inc. All rights reserved. | 23# Copyright 2007 Sun Microsystems, Inc. All rights reserved. |
24# Use is subject to license terms. 25# 26# ident "%Z%%M% %I% %E% SMI" 27 28# This script is the shared method script for the legacy ipv4/ipv6 29# routing services. 30 31. /lib/svc/share/smf_include.sh --- 18 unchanged lines hidden (view full) --- 50 echo "${proto}-routing-daemon not specified by routeadm." 51 exit $SMF_EXIT_ERR_CONFIG 52 fi 53 # No legacy stop command specified. 54 if [ -z "$daemon_stop" ]; then 55 echo "${proto}-routing-stop-cmd not specified by routeadm." 56 exit $SMF_EXIT_ERR_CONFIG 57 fi | 24# Use is subject to license terms. 25# 26# ident "%Z%%M% %I% %E% SMI" 27 28# This script is the shared method script for the legacy ipv4/ipv6 29# routing services. 30 31. /lib/svc/share/smf_include.sh --- 18 unchanged lines hidden (view full) --- 50 echo "${proto}-routing-daemon not specified by routeadm." 51 exit $SMF_EXIT_ERR_CONFIG 52 fi 53 # No legacy stop command specified. 54 if [ -z "$daemon_stop" ]; then 55 echo "${proto}-routing-stop-cmd not specified by routeadm." 56 exit $SMF_EXIT_ERR_CONFIG 57 fi |
58 smf_is_globalzone || exit $SMF_EXIT_OK | 58 smf_configure_ip || exit $SMF_EXIT_OK |
59 60 # Run daemon - fail if it does not successfully daemonize. 61 eval "$daemon_prog $daemon_args" 62 if [ "$?" != "0" ]; then 63 echo "Error: $daemon $daemon_args failed to daemonize." 64 exit $SMF_EXIT_ERR_FATAL 65 fi 66 # Create pidfile. 67 daemon_name=`/usr/bin/basename $daemon_prog` | 59 60 # Run daemon - fail if it does not successfully daemonize. 61 eval "$daemon_prog $daemon_args" 62 if [ "$?" != "0" ]; then 63 echo "Error: $daemon $daemon_args failed to daemonize." 64 exit $SMF_EXIT_ERR_FATAL 65 fi 66 # Create pidfile. 67 daemon_name=`/usr/bin/basename $daemon_prog` |
68 /usr/bin/pgrep -P 1 -f $daemon_prog > /var/tmp/${daemon_name}.pid | 68 if smf_is_globalzone; then 69 /usr/bin/pgrep -P 1 -z `smf_zonename` -f $daemon_prog > \ 70 /var/tmp/${daemon_name}.pid 71 else 72 /usr/bin/pgrep -z `smf_zonename` -f $daemon_prog > \ 73 /var/tmp/${daemon_name}.pid 74 fi |
69 ;; 70'stop' ) | 75 ;; 76'stop' ) |
71 smf_is_globalzone || exit $SMF_EXIT_OK | 77 smf_configure_ip || exit $SMF_EXIT_OK |
72 73 # Stop daemon - ignore result. 74 if [ -n "$daemon_stop" ]; then 75 eval "$daemon_stop" 76 fi 77 ;; 78'*' ) 79 echo "Usage: $0 { start | stop }" 80 exit $SMF_EXIT_ERR_FATAL 81 ;; 82esac 83 84exit "$SMF_EXIT_OK" | 78 79 # Stop daemon - ignore result. 80 if [ -n "$daemon_stop" ]; then 81 eval "$daemon_stop" 82 fi 83 ;; 84'*' ) 85 echo "Usage: $0 { start | stop }" 86 exit $SMF_EXIT_ERR_FATAL 87 ;; 88esac 89 90exit "$SMF_EXIT_OK" |