bab9bb6b69
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>
101 lines
2.3 KiB
Bash
Executable File
101 lines
2.3 KiB
Bash
Executable File
#! /bin/sh
|
|
#
|
|
# This is an init script for openembedded
|
|
# Copy it to /etc/init.d/openldap and type
|
|
# > update-rc.d openldap defaults 60
|
|
#
|
|
. /etc/init.d/functions
|
|
|
|
################################################################################
|
|
# Wait for a process to stop running.
|
|
#
|
|
################################################################################
|
|
function wait_for_proc_stop()
|
|
{
|
|
PROGNAME=$1
|
|
TIMEOUT=${2:-"5"}
|
|
|
|
for I in $(seq 1 $TIMEOUT); do
|
|
PID=$(pidof $PROGNAME 2> /dev/null)
|
|
if [ $? -ne 0 ]; then
|
|
## already dead
|
|
return 0
|
|
fi
|
|
sleep 1
|
|
done
|
|
|
|
return 1
|
|
}
|
|
|
|
slapd=/usr/sbin/slapd
|
|
test -x "$slapd" || exit 0
|
|
|
|
RETVAL=0
|
|
|
|
case "$1" in
|
|
start)
|
|
echo -n "Starting SLAPD: "
|
|
if [ -f /etc/openldap/schema/cn=config.ldif ]; then
|
|
start-stop-daemon --start --oknodo --quiet --exec $slapd \
|
|
-- -F /etc/openldap/schema/
|
|
RETVAL=$?
|
|
else
|
|
start-stop-daemon --start --oknodo --quiet --exec $slapd
|
|
RETVAL=$?
|
|
fi
|
|
if [ $RETVAL -ne 0 ]; then
|
|
echo "Failed to start SLAPD."
|
|
exit $RETVAL
|
|
fi
|
|
|
|
# we need to start nscd service as part of this openldap
|
|
# init.d script since SM manages this as a service and both
|
|
# daemons should be running on a controller host
|
|
systemctl status nscd.service
|
|
if [ $? -ne 0 ]; then
|
|
echo -n "Starting NSCD: "
|
|
systemctl start nscd.service
|
|
RETVAL=$?
|
|
if [ $RETVAL -ne 0 ]; then
|
|
echo "Failed to start NSCD."
|
|
exit $RETVAL
|
|
fi
|
|
fi
|
|
|
|
echo "."
|
|
;;
|
|
stop)
|
|
echo -n "Stopping NSCD: "
|
|
systemctl stop nscd.service
|
|
rm -f /var/run/nscd/nscd.pid
|
|
|
|
echo -n "Stopping SLAPD: "
|
|
start-stop-daemon --retry 60 --stop --oknodo --quiet --pidfile /var/run/slapd.pid
|
|
RETVAL=$?
|
|
wait_for_proc_stop $slapd 10
|
|
WRETVAL=$?
|
|
while [ $WRETVAL -eq 1 ]; do
|
|
killproc $slapd
|
|
wait_for_proc_stop $slapd 10
|
|
WRETVAL=$?
|
|
done
|
|
rm -f /var/run/slapd.pid
|
|
echo "."
|
|
;;
|
|
status)
|
|
status $slapd
|
|
[ $? -eq 0 ] || exit $?
|
|
systemctl status nscd.service
|
|
[ $? -eq 0 ] || exit $?
|
|
;;
|
|
restart)
|
|
$0 stop
|
|
$0 start
|
|
;;
|
|
*)
|
|
echo "Usage: /etc/init.d/openldap {start|stop|status|restart}"
|
|
exit 1
|
|
esac
|
|
|
|
exit $RETVAL
|