[packages/onelogin-ldap_connector] use daemon to startup, more params to config
glen
glen at pld-linux.org
Thu Sep 24 16:09:06 CEST 2015
commit d2f434173cd78d49827d6d21e73dd4028ef128f7
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Thu Sep 24 17:07:02 2015 +0300
use daemon to startup, more params to config
ol-ldapc.init | 12 +++++++++---
ol-ldapc.sysconfig | 8 +++++++-
onelogin-ldap_connector.spec | 9 +++++++++
3 files changed, 25 insertions(+), 4 deletions(-)
---
diff --git a/onelogin-ldap_connector.spec b/onelogin-ldap_connector.spec
index 6546d42..4511ef6 100644
--- a/onelogin-ldap_connector.spec
+++ b/onelogin-ldap_connector.spec
@@ -15,6 +15,7 @@ Source1: ol-ldapc.init
Source2: ol-ldapc.sysconfig
URL: https://www.onelogin.com/product/directory
Requires: jre
+Requires: rc-scripts >= 0.4.3.7
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -42,6 +43,14 @@ cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ol-ldapc
%clean
rm -rf $RPM_BUILD_ROOT
+%post
+%service ol-ldapc restart
+
+%preun
+if [ "$1" = "0" ]; then
+ %service -q ol-ldapc stop
+fi
+
%files
%defattr(644,root,root,755)
%doc README
diff --git a/ol-ldapc.init b/ol-ldapc.init
index 157a571..eeea8c6 100755
--- a/ol-ldapc.init
+++ b/ol-ldapc.init
@@ -25,7 +25,9 @@ else
fi
BASEDN="dc=example,dc=org"
-TOKEN=
+TOKEN=""
+SYNC_INTERVAL=30
+OBJECT_CLASSES="posixAccount"
# Get service config - may override defaults
[ -f /etc/sysconfig/ol-ldapc ] && . /etc/sysconfig/ol-ldapc
@@ -41,8 +43,12 @@ start() {
fi
msg_starting "OneLogin LDAP Connector"
- java -XX:-UseGCOverheadLimit -Xmx64M -Xms64M -jar $appdir/ldap-connector.jar \
- --token "$TOKEN" --sync-interval 30 --object-classes "posixAccount" --base-dn "$BASEDN"
+ daemon --fork --chdir "$appdir" \
+ java -XX:-UseGCOverheadLimit -Xmx64M -Xms64M -jar "$appdir/ldap-connector.jar" \
+ --sync-interval "$SYNC_INTERVAL" \
+ --object-classes "$OBJECT_CLASSES" \
+ --base-dn "$BASEDN" \
+ --token "$TOKEN"
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ol-ldapc
diff --git a/ol-ldapc.sysconfig b/ol-ldapc.sysconfig
index 4be96a2..d47f9cc 100644
--- a/ol-ldapc.sysconfig
+++ b/ol-ldapc.sysconfig
@@ -4,4 +4,10 @@
BASEDN="dc=example,dc=org"
# Auth token
-TOKEN=
+TOKEN=""
+
+# interval to poll
+SYNC_INTERVAL=30
+
+# LDAP object classes to sync
+OBJECT_CLASSES="posixAccount"
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/onelogin-ldap_connector.git/commitdiff/d2f434173cd78d49827d6d21e73dd4028ef128f7
More information about the pld-cvs-commit
mailing list