PageRenderTime 73ms CodeModel.GetById 61ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/vp_plugins/sptsd/init.d/sptsd

http://cupsfilter.googlecode.com/
Shell | 101 lines | 49 code | 9 blank | 43 comment | 3 complexity | 4a29684b1bc978f44c20f7f81d2d1f1a MD5 | raw file
  1#! /bin/sh
  2# Copyright (c) 1996-2002 SuSE GmbH Nuernberg, Germany.  All rights reserved.
  3#
  4# Author: Michail Tumashenko <mtumashenko@techoserv.ru>, Vladimir Skomorokhov <sva@technoserv.ru>
  5#
  6# /etc/init.d/sptsd
  7#
  8### BEGIN INIT INFO
  9# Provides:            technoserv
 10# Required-Start:      $network
 11# Required-Stop:
 12# Default-Start:         3 5
 13# Default-Stop:        0 1 6
 14# Description:         start sptsd
 15### END INIT INFO
 16
 17SPTSD=/sbin/sptsd
 18#SPTSD=/usr/local/src/daemon-2010-03-12/sptsd
 19SPTSDIR=/usr/local/src/daemon-2010-03-12/
 20SPTSDCONF=$SPTSDIR/sptsd.conf
 21
 22test -x $SPTSD || exit 5
 23
 24# Shell functions sourced from /etc/rc.status:
 25#      rc_check         check and set local and overall rc status
 26#      rc_status        check and set local and overall rc status
 27#      rc_status -v     ditto but be verbose in local rc status
 28#      rc_status -v -r  ditto and clear the local rc status
 29#      rc_failed        set local and overall rc status to failed
 30#      rc_failed <num>  set local and overall rc status to <num><num>
 31#      rc_reset         clear local rc status (overall remains)
 32#      rc_exit          exit appropriate to overall rc status
 33. /etc/rc.status
 34
 35# First reset status of this service
 36rc_reset
 37
 38# Return values acc. to LSB for all commands but status:
 39# 0 - success
 40# 1 - generic or unspecified error
 41# 2 - invalid or excess argument(s)
 42# 3 - unimplemented feature (e.g. "reload")
 43# 4 - insufficient privilege
 44# 5 - program is not installed
 45# 6 - program is not configured
 46# 7 - program is not running
 47# 
 48# Note that starting an already running service, stopping
 49# or restarting a not-running service as well as the restart
 50# with force-reload (in case signalling is not supported) are
 51# considered a success.
 52
 53# check whether to enable agentx support and get list of installed
 54# agents
 55
 56case "$1" in
 57    start)
 58	echo -n "Starting sptsd"
 59        startproc $SPTSD  
 60#        startproc $SPTSD -c $SPTSDCONF 
 61	rc_status -v
 62	rc_reset
 63
 64	;;
 65    stop)
 66	echo -n "Shutting down sptsd:"
 67	killproc -TERM $SPTSD
 68	rc_status -v ; rc_reset
 69	;;
 70    try-restart)
 71	$0 status >/dev/null &&  $0 restart
 72	rc_status
 73	;;
 74    restart)
 75	$0 stop
 76	$0 start
 77	rc_status
 78	;;
 79    force-reload)
 80	echo -n "Reload service sptsd:"
 81	killproc -HUP $SPTSD
 82	rc_status -v
 83	;;
 84    reload)
 85	echo -n "Reload service sptsd:"
 86	killproc -HUP $SPTSD
 87	rc_status -v
 88	;;
 89    status)
 90	echo -n "Checking for service sptsd:"
 91	checkproc $SPTSD
 92	rc_status -v
 93	rc_reset
 94	;;
 95    *)
 96	echo "Usage: $0 {start|stop|try-restart|restart|force-reload|reload|status}"
 97	exit 1
 98	;;
 99esac
100rc_exit
101