Browse Source

n/ldap: Added rc script.

slackware-14.2
Damien Goutte-Gattat 12 years ago
parent
commit
72b56684c4
3 changed files with 40 additions and 4 deletions
  1. +1
    -1
      n/openldap/doinst.sh
  2. +5
    -3
      n/openldap/openldap.SlackBuild
  3. +34
    -0
      n/openldap/rc.openldap

+ 1
- 1
n/openldap/doinst.sh View File

@ -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

+ 5
- 3
n/openldap/openldap.SlackBuild View File

@ -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
- 0
n/openldap/rc.openldap View File

@ -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