integ/base/net-snmp/files/snmpd.cgcs
Scott Little bab9bb6b69 Internal restructuring of stx-integ
Create new directories:
   ceph
   config
   config-files
   filesystem
   kernel
   kernel/kernel-modules
   ldap
   logging
   strorage-drivers
   tools
   utilities
   virt

Retire directories:
   connectivity
   core
   devtools
   support
   extended

Delete two packages:
   tgt
   irqbalance

Relocated packages:
   base/
      dhcp
      initscripts
      libevent
      lighttpd
      linuxptp
      memcached
      net-snmp
      novnc
      ntp
      openssh
      pam
      procps
      sanlock
      shadow
      sudo
      systemd
      util-linux
      vim
      watchdog

   ceph/
      python-cephclient

   config/
      facter
      puppet-4.8.2
      puppet-modules

   filesystem/
      e2fsprogs
      nfs-utils
      nfscheck

   kernel/
      kernel-std
      kernel-rt

   kernel/kernel-modules/
      mlnx-ofa_kernel

   ldap/
      nss-pam-ldapd
      openldap

   logging/
      syslog-ng
      logrotate

   networking/
      lldpd
      iproute
      mellanox
      python-ryu
      mlx4-config

   python/
      python-2.7.5
      python-django
      python-gunicorn
      python-setuptools
      python-smartpm
      python-voluptuous

   security/
      shim-signed
      shim-unsigned
      tboot

   strorage-drivers/
      python-3parclient
      python-lefthandclient

   virt/
      cloud-init
      libvirt
      libvirt-python
      qemu

   tools/
      storage-topology
      vm-topology

   utilities/
      tis-extensions
      namespace-utils
      nova-utils
      update-motd

Change-Id: I37ade764d873c701b35eac5881eb40412ba64a86
Story: 2002801
Task: 22687
Signed-off-by: Scott Little <scott.little@windriver.com>
2018-08-01 10:06:31 -04:00

96 lines
2.0 KiB
Bash

#! /bin/sh
# /etc/init.d/snmpd: start snmp daemon.
. /etc/init.d/functions
# Linux Standard Base (LSB) Error Codes
RETVAL=0
GENERIC_ERROR=1
INVALID_ARGS=2
NOT_RUNNING=3
NOT_INSTALLED=5
#set environment variables
export SNMPCONFPATH=/etc/snmp
export MIBDIRS=/usr/share/snmp/mibs
SNMPDOPTS='oamcontroller -u snmpd -LS6d -Lf /dev/null -p /var/run/snmpd.pid'
PIDFILE=/var/run/snmpd.pid
SNMPTRAPDCONFIG=${SNMPCONFPATH}/snmpdtrapd.conf
SNMPDCONFIG=${SNMPCONFPATH}/snmpd.conf
SNMPDNAME=snmpd
SNMPD="/usr/sbin/${SNMPDNAME}"
test -x ${SNMPD} || exit ${NOT_INSTALLED}
# Reads config file (will override defaults above)
[ -r /etc/default/snmpd ] && . /etc/default/snmpd
case "$1" in
start)
echo -n "Starting network management services: "
status ${SNMPD} >/dev/null
if [ $? -eq 0 ]; then
echo -n "is already running "
RETVAL=0
elif [ -f ${SNMPDCONFIG} ]; then
start-stop-daemon -o --start --quiet --name ${SNMPDNAME} --pidfile "$PIDFILE" \
--exec ${SNMPD} -- ${SNMPDOPTS}
RETVAL=$?
else
logger "${SNMPDCONFIG} is missing"
RETVAL=${GENERIC_ERROR}
fi
if [ ${RETVAL} -eq 0 ] ; then
pid=`pidof ${SNMPDNAME}`
echo "OK"
logger "${SNMPDNAME} (${pid})"
else
echo "FAIL"
RETVAL=${GENERIC_ERROR}
fi
;;
stop)
status ${SNMPD} >/dev/null
if [ $? -ne 0 ]; then
echo "$SNMPDNAME is not running"
RETVAL=0
else
echo -n "Stopping network management services "
killproc ${SNMPDNAME}
if [ -n "`pidof ${SNMPDNAME}`" ] ; then
logger "Going to SIGKILL ${SNMPDNAME}"
killproc -KILL ${SNMPDNAME}
fi
/bin/rm -rf $PIDFILE
status ${SNMPD} >/dev/null
if [ $? -ne 0 ]; then
echo "Stopped"
RETVAL=0
else
echo "Failed"
RETVAL=${GENERIC_ERROR}
fi
fi
;;
status)
status ${SNMPD} >/dev/null
RETVAL=$?
if [ ! ${RETVAL} -eq 0 ] ; then
RETVAL=${NOT_RUNNING}
fi
;;
restart|reload|force-reload)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: /etc/init.d/snmpd {start|stop|status|restart|reload|force-reload}"
exit ${GENERIC_ERROR}
esac
exit $RETVAL