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

updated phonon and phonon-dev (4.7.2 -> 4.10.2)
author Hans-G?nter Theisgen
date Sun Jun 02 11:16:48 2019 +0100 (2019-06-02)
parents 97a1415c2ffa
children
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="$(_ '%s server' LDAP)"
13 DAEMON=/usr/lib/openldap/slapd
14 OPTIONS=$LDAP_OPTIONS
15 PIDFILE=/var/lib/openldap/run/slapd.pid
17 case "$1" in
18 start)
19 if active_pidfile $PIDFILE slapd ; then
20 _ '%s is already running.' $NAME
21 exit 1
22 fi
23 action 'Starting %s: %s...' "$DESC" $NAME
24 $DAEMON $OPTIONS && sleep 2
25 status
26 for i in /etc/ldap.d/* ; do
27 [ -x $i ] || continue
28 action 'Running %s...' $i
29 $i
30 status
31 done
32 ;;
33 stop)
34 if ! active_pidfile $PIDFILE slapd ; then
35 _ '%s is not running.' $NAME
36 exit 1
37 fi
38 action 'Stopping %s: %s...' "$DESC" $NAME
39 kill $(cat $PIDFILE)
40 status
41 ;;
42 restart)
43 if ! active_pidfile $PIDFILE slapd ; then
44 _ '%s is not running.' $NAME
45 exit 1
46 fi
47 action 'Restarting %s: %s...' "$DESC" $NAME
48 kill $(cat $PIDFILE)
49 sleep 2
50 $DAEMON $OPTIONS && sleep 2
51 status
52 ;;
53 *)
54 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
55 newline
56 exit 1
57 ;;
58 esac
60 exit 0