wok view openldap/stuff/etc/init.d/openldap @ rev 2077

Add: meta xfce4 (Xfce Desktop Environment) .
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Fri Jan 23 23:13:33 2009 +0100 (2009-01-23)
parents 1dd05d636371
children 8a251dbc2bed
line source
1 #!/bin/sh
2 # /etc/init.d/openldap : Start, stop and restart LDAP server on SliTaz, at
3 # boot time or with the command line.
4 #
5 # To start LDAP server at boot time, just put openldap in the $RUN_DAEMONS
6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf
7 #
8 . /etc/init.d/rc.functions
9 . /etc/daemons.conf
11 NAME=Openldap
12 DESC="LDAP server"
13 DAEMON=/usr/libexec/slapd
14 OPTIONS=$LDAP_OPTIONS
15 PIDFILE=/var/run/slapd.pid
17 case "$1" in
18 start)
19 if [ -f $PIDFILE ] ; then
20 echo "$NAME already running."
21 exit 1
22 fi
23 if [ ! -f /var/openldap-data/__db.001 ]; then
24 echo -n "Starting $DESC: $NAME... "
25 $DAEMON $OPTIONS && sleep 2
26 status
27 for i in /etc/ldap.d/* ; do
28 [ -x $i ] || continue
29 echo "Running $i..."
30 $i
31 done
32 else
33 echo -n "Starting $DESC: $NAME... "
34 $DAEMON $OPTIONS && sleep 2
35 status
36 fi
37 ;;
38 stop)
39 if [ ! -f $PIDFILE ] ; then
40 echo "$NAME is not running."
41 exit 1
42 fi
43 echo -n "Stopping $DESC: $NAME... "
44 kill `cat $PIDFILE`
45 status
46 ;;
47 restart)
48 if [ ! -f $PIDFILE ] ; then
49 echo "$NAME is not running."
50 exit 1
51 fi
52 echo -n "Restarting $DESC: $NAME... "
53 kill `cat $PIDFILE`
54 sleep 2
55 $DAEMON $OPTIONS && sleep 2
56 status
57 ;;
58 *)
59 echo ""
60 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
61 echo ""
62 exit 1
63 ;;
64 esac
66 exit 0