This commit is contained in:
Mario Fetka
2014-08-16 09:01:13 +02:00
parent ab666604a2
commit 4492b6ea57
182 changed files with 7524 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
NDSD_OPTS=""
NDSD_CONFIGFILE="/etc/opt/novell/eDirectory/nds.conf"

View File

@@ -0,0 +1,37 @@
#!/sbin/runscript
depend() {
need net
after slpuasa slpd
}
checkconfig() {
if [ ! -e ${NDSD_CONFIGFILE} ] ; then
eerror "Novell eDirectory server has not been configured."
return 1
fi
}
start() {
ebegin "Starting Novell eDirectory server"
start-stop-daemon --start --quiet --exec /opt/novell/eDirectory/sbin/ndsd \
--pidfile /var/nds/ndsd.pid -- ${NDSD_OPTS} -f ${NDSD_CONFIGFILE}
eend $?
}
stop() {
ebegin "Stopping Novell eDirectory server"
start-stop-daemon --stop --quiet --signal INT --retry 30 --pidfile /var/nds/ndsd.pid
eend $?
if [ -f /var/nds/ndsd.pid ]; then
ebegin "WARNING: ndsd process is still running. Killing Novell eDirectory server"
echo "WARNING: ndsd process is still running. Killing ndsd." >> /var/nds/ndsd.log
start-stop-daemon --stop --quiet --signal KILL --pidfile /var/nds/ndsd.pid
rm /var/nds/ndsd.pid
eend $?
fi
}
#restart() {
# (Commands necessary to restart the service)
#}

View File

@@ -0,0 +1,13 @@
#!/bin/sh
#
# Copyright (c) 2007, Mario Fetka <mario-fetka@gmx.at>
#
# Licensed under the GNU General Public License, v2
# fake initd for stupid /usr/sbib/ndsconfig
# and the real nldap start script is named nldapd
echo "!!!! fake init.d script !!!!"
echo " use the nldapd init script"
eval exec rc-config start nldapd

View File

@@ -0,0 +1,139 @@
#!/sbin/runscript
#
# Copyright (c) 2004 Novell, Inc.
# All rights reserved.
#
# Script to wait till nldap TLS port comes up or timeout after 60 secs approx.
#
# Simplyfied and Gentooized by Mario Fetka <fetka@arge.at>
depend() {
need ndsd
use ndsd
after ndsd
}
checkconfig() {
if [ ! -e /var/nds/ndsd.pid ] ; then
eerror "Novell eDirectory server has not been started."
return 1
fi
}
#
# Get nldap TCP Port status
# Cases:
# 1. nldap not loaded (nldap -c return 1 to the shell)
# 2. nldap TCP port is not listening (nldap -c returns 176 to the shell)
# 3. nldap 389 is disabled (nldap -c return 255 to the shell)
# 4. nldap TCP port is listning (nldap -c return 0 to the shell)
GetTCPPortStatus () {
count=1
while [ $count -ne 30 ]
do
if [ -f /opt/novell/eDirectory/sbin/nldap ]; then
/opt/novell/eDirectory/sbin/nldap -c > /dev/null 2>&1 # check the status
returnValue=$?
if [ $returnValue -eq 0 ]; then
ebegin "Novell eDirectory LDAP Server TCP port is listening"
eend 0
break
fi
else
ebegin "Novell eDirectory /opt/novell/eDirectory/sbin/nldap not found"
eend 1
fi
sleep 1 # wait for maximum 60 seconds
count=`expr $count + 1`
done
if [ $returnValue -eq 255 ]; then
ebegin "Novell eDirectory LDAP Server TCP port is disabled"
eend 1
elif [ $returnValue -ne 0 ]; then
ebegin "Novell eDirectory LDAP Server TCP port is not listening"
eend 1
fi
} # GetTCPPortStatus
#
# Get nldap TLS Port status
# Cases:
# 1. nldap not loaded (nldap -s return 1 to the shell)
# 2. nldap TLS port is not listening (nldap -s returns 176 to the shell)
# 3. nldap 636 is disabled (nldap -s return 255 to the shell)
# 4. nldap TLS port is listning (nldap -s return 0 to the shell)
GetTLSPortStatus () {
count=1
while [ $count -ne 30 ]
do
if [ -f /opt/novell/eDirectory/sbin/nldap ]; then
/opt/novell/eDirectory/sbin/nldap -s > /dev/null 2>&1 # check the status
returnValue=$?
if [ $returnValue -eq 0 ]; then
ebegin "Novell eDirectory LDAP Server TLS port is listening"
eend 0
fi
if [ $returnValue -eq 204 ]; then
if [ $count -ge 10 ]; then
ebegin "LDAP Server is not associated with Certificate"
eend 1
fi
fi
if [ $returnValue -eq 255 ]; then
ebegin "Novell eDirectory LDAP Server TLS port is disabled"
eend 1
fi
else
ebegin "Novell eDirectory $sbindir/nldap not found"
eend 1
fi
sleep 1 # wait for maximum 60 seconds
count=`expr $count + 1`
done
/opt/novell/eDirectory/sbin/nldap -c > /dev/null 2>&1 # check the status
if [ "$?" -eq 1 ]; then
ebegin "Novell eDirectory LDAP services are not running"
eend 1
else
ebegin "Novell eDirectory LDAP Server TLS port is not listening"
eend 1
fi
} # GetTLSPortStatus
#
# MAIN FUNCTION
#
start() {
if [ -f /var/nds/ndsd.pid ]; then
GetTCPPortStatus # TCP Port status
GetTLSPortStatus # TLS Port status
else
eend 1
fi
}
stop() {
/opt/novell/eDirectory/sbin/nldap -u > /dev/null 2>&1 # check the status
if [ "$?" -eq 1 ]; then
ebegin "Novell eDirectory LDAP services are not running"
eend 1
else
ebegin "Novell eDirectory LDAP Server TCP and TLS port is not listening"
eend 0
fi
}
#restart() {
# (Commands necessary to restart the service)
#}