Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 1 | #! /bin/sh |
| 2 | # |
| 3 | # This is an init script for openembedded |
| 4 | # Copy it to /etc/init.d/openldap and type |
| 5 | # > update-rc.d openldap defaults 60 |
| 6 | # |
| 7 | |
| 8 | # Source function library. |
| 9 | . /etc/init.d/functions |
| 10 | |
| 11 | slapd=/usr/sbin/slapd |
| 12 | test -x "$slapd" || exit 0 |
| 13 | |
| 14 | |
| 15 | case "$1" in |
| 16 | start) |
| 17 | echo -n "Starting OpenLDAP: " |
| 18 | start-stop-daemon --start --quiet --exec $slapd |
| 19 | echo "." |
| 20 | ;; |
| 21 | stop) |
| 22 | echo -n "Stopping OpenLDAP: " |
| 23 | start-stop-daemon --stop --quiet --pidfile /var/run/slapd.pid |
| 24 | echo "." |
| 25 | ;; |
| 26 | status) |
| 27 | status $slapd; |
| 28 | exit $? |
| 29 | ;; |
| 30 | *) |
| 31 | echo "Usage: /etc/init.d/openldap {start|stop|status}" |
| 32 | exit 1 |
| 33 | esac |
| 34 | |
| 35 | exit 0 |