#! /sbin/sh
# 
# $Copyright
# Copyright 1993, 1994, 1995  Intel Corporation
# INTEL CONFIDENTIAL
# The technical data and computer software contained herein are subject
# to the copyright notices; trademarks; and use and disclosure
# restrictions identified in the file located in /etc/copyright on
# this system.
# Copyright$
# 
 
#
# (c) Copyright 1990, OPEN SOFTWARE FOUNDATION, INC.
# ALL RIGHTS RESERVED
#
#
# OSF/1 Release 1.0

# Control the kernel load service

PATH=/sbin:/usr/sbin:/usr/bin
export PATH

case "$1" in
'start')
        set `who -r`
        if [ $9 = "S" ]; then
                if [ -x /sbin/kloadsrv ]; then
                        if /sbin/kloadsrv; then
                	        echo "Kernel load service started"
                        else
                                echo "Cannot start kernel load service"
                        fi
                fi
        fi                        
        ;;
'stop')
        if [ -r /var/run/kloadsrv.pid ]; then
                kill `cat /var/run/kloadsrv.pid`
        else
                echo "ERROR: cannot find /var/run/kloadsrv.pid to kill kloadsrv."
        fi
        ;;
'restart')
        if [ -r /var/run/kloadsrv.pid ]; then
                kill `cat /var/run/kloadsrv.pid`
                if /sbin/kloadsrv; then
        	        echo "Kernel load service re-started"
                else
                        echo "Cannot re-start kernel load service"
                 fi
        else
                echo "ERROR: cannot find /var/run/kloadsrv.pid to restart kloadsrv."
        fi
        ;;
*)
        echo "usage: $0 {start|stop|restart}"
        ;;
esac
