mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noël Rouvignac
09.23.2015 af53fd679c68f6fdee3a88a612fe179816c4eb5b
OPENDJ-2520 rpm: opendj service not restarted after a reboot

This problem happens because the opendj service is actually not stopped the machine shuts down
Various distributions maintain a lock file (or equivalent) that must be created on service startup
and removed on service shutdown.
Current change modifies the service script to create and remove this lockfile.
3 files modified
17 ■■■■■ changed files
opendj-packages/opendj-deb/resources/changelog 6 ●●●●● patch | view | raw | blame | history
opendj-packages/opendj-rpm/resources/changelog 3 ●●●●● patch | view | raw | blame | history
opendj-packages/resources/sysv/opendj 8 ●●●●● patch | view | raw | blame | history
opendj-packages/opendj-deb/resources/changelog
@@ -1,5 +1,11 @@
 opendj (3.0.0) unstable; urgency=low
  * init.d service script now generates and removes a lockfile.
 -- ForgeRock <opendj@forgerock.org>  Wed, 9 Dec 2015 16:24:00 +0100
 opendj (3.0.0) unstable; urgency=low
  * Package is now build using maven.
 -- ForgeRock <opendj@forgerock.org>  Tue, 10 Mar 2015 14:24:00 +0100
opendj-packages/opendj-rpm/resources/changelog
@@ -27,6 +27,9 @@
# =============================
%changelog
* Wed Dec  9 2015 ForgeRock
- init.d service script now generates and removes a lockfile.
* Thu Mar  5 2015 ForgeRock
- Package is now build using maven.
opendj-packages/resources/sysv/opendj
@@ -50,16 +50,21 @@
if [ -f /etc/redhat-release ] ; then
    # Redhat
    . /etc/init.d/functions
    LOCKFILE=/var/lock/subsys/opendj
elif [ -f /etc/SuSE-release ] ; then
    # SuSE
    . /etc/rc.status
    LOCKFILE=/var/run/rcopendj
elif [ -f /etc/lsb-release ] ; then
    # Debian
    . /lib/lsb/init-functions
    LOCKFILE=/var/lock/opendj
elif [ -f /etc/init.d/functions.sh ] ; then
    # Other dist.
    . /etc/init.d/functions.sh
    LOCKFILE=/tmp/unused-lockfile-opendj
fi
# LOCKFILE is used by the service subsystem to know whether the opendj service is started and act upon it
# Sets the script vars
@@ -95,6 +100,7 @@
        echo "Instance is not configured. Please run $INSTALL_ROOT/setup"
        return 1
    fi
    echo -n "Starting $DAEMON: "
    # Server is running
    if [ -e $PIDFILE ] ; then
@@ -104,6 +110,7 @@
        "$INSTALL_ROOT"/bin/start-ds --quiet
        RETVAL=$?
        if [ $RETVAL = 0 ] ; then
            touch $LOCKFILE
            echo "> SUCCESS."
        else
            echo "> FAILURE."
@@ -132,6 +139,7 @@
        else
            echo "> FAILURE."
        fi
        rm -f $LOCKFILE
        echo ""
        return $RETVAL
    else