[packages/onelogin-ldap_connector] add initscript
glen
glen at pld-linux.org
Thu Sep 24 13:19:41 CEST 2015
commit 05116c837cef386257eee32c669a024ef7524548
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Wed Feb 25 15:55:23 2015 +0200
add initscript
ol-ldapc.init | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 122 insertions(+)
---
diff --git a/ol-ldapc.init b/ol-ldapc.init
new file mode 100755
index 0000000..71b221d
--- /dev/null
+++ b/ol-ldapc.init
@@ -0,0 +1,122 @@
+#!/bin/sh
+#
+# ol-ldapc Onelogin Directory Integration
+# chkconfig: 345 <start_level> <stop_level>
+# description: ol-ldapc Onelogin Directory Integration
+# processname: java
+# config:
+# pidfile:
+#
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+ if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+ msg_network_down "OneLogin LDAP Connector"
+ exit 1
+ fi
+else
+ exit 0
+fi
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/ol-ldapc ] && . /etc/sysconfig/ol-ldapc
+
+pidfile="/var/run/ol-ldapc.pid"
+
+start() {
+ # Check if the service is already running?
+ if [ -f /var/lock/subsys/ol-ldapc ]; then
+ msg_already_running "OneLogin LDAP Connector"
+ return
+ fi
+
+ msg_starting "OneLogin LDAP Connector"
+ BASEDN="dc=delfi,dc=net"
+ TOKEN=1
+ java -XX:-UseGCOverheadLimit -Xmx64M -Xms64M -jar /usr/share/onelogin-ldap_connector/ldap-connector.jar \
+ --token $TOKEN --sync-interval 30 --object-classes "posixAccount" --base-dn $BASEDN
+
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ol-ldapc
+}
+
+stop() {
+ if [ ! -f /var/lock/subsys/ol-ldapc ]; then
+ msg_not_running "OneLogin LDAP Connector"
+ return
+ fi
+
+ # Stop daemons.
+ msg_stopping "OneLogin LDAP Connector"
+ killproc java
+ killproc --pidfile $pidfile java -TERM
+ rm -f /var/lock/subsys/ol-ldapc
+}
+
+reload() {
+ if [ ! -f /var/lock/subsys/ol-ldapc ]; then
+ msg_not_running "OneLogin LDAP Connector"
+ RETVAL=7
+ return
+ fi
+
+ msg_reloading "OneLogin LDAP Connector"
+ killproc java -HUP
+ killproc --pidfile $pidfile java -HUP
+ RETVAL=$?
+}
+
+condrestart() {
+ if [ ! -f /var/lock/subsys/ol-ldapc ]; then
+ msg_not_running "OneLogin LDAP Connector"
+ RETVAL=$1
+ return
+ fi
+
+ stop
+ start
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ try-restart)
+ condrestart 0
+ ;;
+# include force-reload here if program allows reloading without restart
+# otherwise remove reload action and support force-reload as restart if running
+ reload|force-reload)
+ reload
+ ;;
+# use this one if program doesn't support reloading without restart
+ force-reload)
+ condrestart 7
+ ;;
+ status)
+ status ol-ldapc
+ status --pidfile $pidfile ol-ldapc
+ status --pidfile $pidfile ol-ldapc java
+ RETVAL=$?
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
+ exit 3
+esac
+
+exit $RETVAL
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/onelogin-ldap_connector.git/commitdiff/646002b6d5abd786c56ee621f3ca6c94af36fe42
More information about the pld-cvs-commit
mailing list