From aedaf5652dd9b728942b9f30836458fe80a423c1 Mon Sep 17 00:00:00 2001
From: Violette Roche-Montane <violette.roche-montane@forgerock.com>
Date: Thu, 22 Aug 2013 09:38:01 +0000
Subject: [PATCH] OPENDJ-1114 Improve the debian package - Original data are copied under build/deb/ folder as the process to build the deb package implies to modify the source. - Opendj init script has been modified. Indeed, under debian OS (and others) the /var/run/ folder is deleted at reboot, deleting by the same way our pid file, making the service wobbly. - As linux distro use the same opendj file, a new folder was created under resource to store the shared file between them. - At last, modified post/prem/specFile as well as the fact to create a symlink on an existing one throws an error. (same when you try to remove one from no-existing)
---
opends/resource/rpm/specFile | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/opends/resource/rpm/specFile b/opends/resource/rpm/specFile
index 8702a13..cd56725 100644
--- a/opends/resource/rpm/specFile
+++ b/opends/resource/rpm/specFile
@@ -129,8 +129,8 @@
%post
# Registers the service
/sbin/chkconfig --add opendj
-# Symlink to process ID
-ln -s /opt/opendj/logs/server.pid /var/run/opendj.pid
+# Symlinks to process ID
+test -h "/var/run/opendj.pid" || ln -s /opt/opendj/logs/server.pid /var/run/opendj.pid
if [ "$1" == "1" ] ; then
echo "Post Install - initial install"
else if [ "$1" == "2" ] ; then
@@ -177,7 +177,7 @@
/etc/init.d/opendj stop >/dev/null 2>&1
/sbin/chkconfig --del opendj
# Unlink the symlink to the process ID.
- unlink /var/run/opendj.pid
+ test -h "/var/run/opendj.pid" && unlink /var/run/opendj.pid
# Only if the instance has been configured
if [ -e "%{_prefix}"/config/buildinfo ] && [ "$(ls -A "%{_prefix}"/config/archived-configs)" ]
then
@@ -221,3 +221,6 @@
- Added '%doc' section.
- Added '%changelog' at the end of the file.
- Added license to header's files.
+
+* Thu Aug 22 2013 ForgeRock
+- Modified init.d script.
--
Gitblit v1.10.0