Browse Source

n/ldap: Added rc script.

slackware-14.2
Damien Goutte-Gattat 13 years ago
parent
commit
72b56684c4
  1. 2
      n/openldap/doinst.sh
  2. 8
      n/openldap/openldap.SlackBuild
  3. 34
      n/openldap/rc.openldap

2
n/openldap/doinst.sh

@ -20,4 +20,4 @@ if ! grep ^ldap /etc/passwd > /dev/null ; then
/usr/sbin/useradd -c OpenLDAP -d /var/lib/openldap-data -g ldap ldap
fi
chown -R ldap:ldap /var/lib/openldap-data /var/lib/openldap-slurpd
chown -R ldap:ldap /var/lib/openldap-data /var/lib/openldap-slurp

8
n/openldap/openldap.SlackBuild

@ -109,6 +109,7 @@ rm $PKG/etc/openldap/ldap.conf.default
rm $PKG/etc/openldap/slapd.conf.default
mv $PKG/etc/openldap/ldap.conf $PKG/etc/openldap/ldap.conf.new
mv $PKG/etc/openldap/slapd.conf $PKG/etc/openldap/slapd.conf.new
sed -r -i 's|/var/lib/run/|/var/run/|' $PKG/etc/openldap/slapd.conf.new
# Strip binaries
find $PKG | xargs file | grep "ELF 32-bit LSB" | cut -d : -f 1 | \
@ -124,9 +125,10 @@ install -m 644 \
$PKG/usr/doc/$NAME
cp -a doc/devel doc/drafts doc/guide doc/rfc $PKG/usr/doc/$NAME/docs
# Copy slack-desc and doinst.sh files
install -D -m 644 $CWD/slack-desc $PKG/install/slack-desc
install -m 755 $CWD/doinst.sh $PKG/install/doinst.sh
# Copy auxiliary files
install -D -m 644 $CWD/slack-desc $PKG/install/slack-desc
install -m 755 $CWD/doinst.sh $PKG/install/doinst.sh
install -D -m 644 $CWD/rc.openldap $PKG/etc/rc.d/rc.openldap
# Package the tree
cd $PKG

34
n/openldap/rc.openldap

@ -0,0 +1,34 @@
#!/bin/sh
PIDFILE=/var/run/slapd.pid
start()
{
/usr/libexec/slapd -u ldap -g ldap
}
stop()
{
[ -f /var/run/slapd.pid ] && kill -INT `cat /var/run/slapd.pid`
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 2
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
Loading…
Cancel
Save