56 lines
1.3 KiB
Diff
56 lines
1.3 KiB
Diff
diff --git a/nslcd.init b/nslcd.init
|
|
new file mode 100755
|
|
index 0000000..9583a08
|
|
--- /dev/null
|
|
+++ b/nslcd.init
|
|
@@ -0,0 +1,49 @@
|
|
+#!/bin/sh
|
|
+########################################################################
|
|
+#
|
|
+# Notes :
|
|
+#NSLCD DAEMON START
|
|
+#
|
|
+########################################################################
|
|
+
|
|
+. /etc/sysconfig/rc
|
|
+. ${rc_functions}
|
|
+NSLCD_NAME=nslcd
|
|
+NSLCD_BIN="/usr/sbin/$NSLCD_NAME"
|
|
+NSLCD_DESC="LDAP connection daemon"
|
|
+NSLCD_CFG="/etc/nslcd.conf"
|
|
+STATEDIR="/var/run/nslcd"
|
|
+NSLCD_PIDFILE="$STATEDIR/nslcd.pid"
|
|
+export PATH="/usr/libexec/elmac/bin:${PATH}:/usr/sbin:/sbin"
|
|
+
|
|
+
|
|
+case "${1}" in
|
|
+ start)
|
|
+ [ -d "$STATEDIR" ] || ( mkdir -m 755 "$STATEDIR"; chown nslcd:nslcd "$STATEDIR" )
|
|
+ boot_mesg "Starting $NSLCD_BIN nss daemon..."
|
|
+start-stop-daemon --start --exec $NSLCD_BIN --oknodo --pidfile $NSLCD_PIDFILE
|
|
+ #log_end_msg $?
|
|
+ ;;
|
|
+
|
|
+ stop)
|
|
+ boot_mesg "Stopping nslcd nss daemon..."
|
|
+ start-stop-daemon --stop --oknodo \
|
|
+ --pidfile $NSLCD_PIDFILE \
|
|
+ --name "$NSLCD_NAME"
|
|
+ #log_end_msg $?
|
|
+ [ -n "$NSLCD_PIDFILE" ] && rm -f $NSLCD_PIDFILE
|
|
+ ;;
|
|
+
|
|
+ restart)
|
|
+ ${0} stop
|
|
+ sleep 2
|
|
+ ${0} start
|
|
+ ;;
|
|
+
|
|
+ *)
|
|
+ echo "Usage: ${0} {start|stop|restart}"
|
|
+ exit 1
|
|
+ ;;
|
|
+esac
|
|
+# End $rc_base/init.d/nslcd
|
|
+
|