directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r643331 - in /directory/sandbox/pamarcelot/trunks/apacheds-additional-installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers: bin/apacheds-init bin/install.sh deb/apacheds-init deb/postinst
Date Tue, 01 Apr 2008 09:18:36 GMT
Author: pamarcelot
Date: Tue Apr  1 02:18:15 2008
New Revision: 643331

URL: http://svn.apache.org/viewvc?rev=643331&view=rev
Log:
Updated BIN and DEB installers with creation of the apacheds when needed. The Bin installer
now makes the server run under the apacheds user.

Modified:
    directory/sandbox/pamarcelot/trunks/apacheds-additional-installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/apacheds-init
    directory/sandbox/pamarcelot/trunks/apacheds-additional-installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/install.sh
    directory/sandbox/pamarcelot/trunks/apacheds-additional-installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/deb/apacheds-init
    directory/sandbox/pamarcelot/trunks/apacheds-additional-installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/deb/postinst

Modified: directory/sandbox/pamarcelot/trunks/apacheds-additional-installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/apacheds-init
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/trunks/apacheds-additional-installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/apacheds-init?rev=643331&r1=643330&r2=643331&view=diff
==============================================================================
--- directory/sandbox/pamarcelot/trunks/apacheds-additional-installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/apacheds-init
(original)
+++ directory/sandbox/pamarcelot/trunks/apacheds-additional-installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/apacheds-init
Tue Apr  1 02:18:15 2008
@@ -46,7 +46,7 @@
 PRIORITY=
 
 # Location of the pid file.
-PIDDIR="/var/run"
+PIDDIR="/var/run/@app@-@app.version@"
 
 # If uncommented, causes the Wrapper to be shutdown using an anchor file.
 #  When launched with the 'start' command, it will also ignore all INT and
@@ -61,8 +61,7 @@
 # NOTE - This will set the user which is used to run the Wrapper as well as
 #  the JVM and is not useful in situations where a privileged resource or
 #  port needs to be allocated prior to the user being changed.
-#RUN_AS_USER=$APP_NAME
-RUN_AS_USER=root
+RUN_AS_USER=$APP_NAME
 
 # Do not modify anything beyond this point
 #-----------------------------------------------------------------------------
@@ -139,7 +138,7 @@
 
 # Process ID
 ANCHORFILE="$PIDDIR/@app@-@app.version@-$INSTANCE.anchor"
-PIDFILE="$PIDDIR/@app@-@app.version@-$INSTANCE.pid"
+PIDFILE="$PIDDIR/$INSTANCE.pid"
 LOCKDIR="/var/lock/subsys"
 LOCKFILE="$LOCKDIR/$INSTANCE"
 pid=""
@@ -406,8 +405,7 @@
 }
 
 usage() {
-    echo "Please enter an instance name..."
-    echo "Usage: $0 <command> <instance name>"
+    echo "Usage: $0 <command>"
     echo "  Available Commands: "
     echo "      console     - Run in interactive mode with log output to the console."
     echo "                    Press CTRL-C to stop."
@@ -587,7 +585,7 @@
         ;;
 
     *)
-        echo "Usage: $0 { console | start | stop | restart | status | dump } <instance
name>"
+        echo "Usage: $0 { console | start | stop | restart | status | dump }"
         exit 1
         ;;
 esac

Modified: directory/sandbox/pamarcelot/trunks/apacheds-additional-installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/install.sh
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/trunks/apacheds-additional-installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/install.sh?rev=643331&r1=643330&r2=643331&view=diff
==============================================================================
--- directory/sandbox/pamarcelot/trunks/apacheds-additional-installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/install.sh
(original)
+++ directory/sandbox/pamarcelot/trunks/apacheds-additional-installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/install.sh
Tue Apr  1 02:18:15 2008
@@ -54,6 +54,10 @@
 mkdir -p $DEFAULT_INSTANCE_HOME_DIRECTORY/run
 verifyExitCode
 
+# Creating the PID directory
+mkdir -p /var/run/apacheds-$APACHEDS_VERSION
+verifyExitCode
+
 # Copying the default instance files
 cp ../root/instance/apacheds.conf $DEFAULT_INSTANCE_HOME_DIRECTORY/conf/
 verifyExitCode
@@ -79,16 +83,23 @@
 verifyExitCode
 
 # Setting the correct permissions on executable files
-chmod 755 /etc/init.d/apacheds-$APACHEDS_VERSION-$DEFAULT_INSTANCE_NAME
+chmod +x /etc/init.d/apacheds-$APACHEDS_VERSION-$DEFAULT_INSTANCE_NAME
 verifyExitCode
-chmod 755 $APACHEDS_HOME_DIRECTORY/bin/apacheds
+chmod +x $APACHEDS_HOME_DIRECTORY/bin/apacheds
 verifyExitCode
 
 # Creating the apacheds user (only if needed)
-#USER=`eval "id -u -n apacheds"`
-#if [ ! "Xapacheds" = "X$USER" ]
-#then
-	#verifyExitCode
-	#useradd apacheds
-	#verifyExitCode
-#fi
+USER=`eval "id -u -n apacheds"`
+if [ ! "Xapacheds" = "X$USER" ]
+then
+	/usr/sbin/groupadd apacheds >/dev/null 2>&1 || :
+	verifyExitCode
+	/usr/sbin/useradd -g apacheds -d $APACHEDS_HOME_DIRECTORY apacheds >/dev/null 2>&1
|| :
+	verifyExitCode
+fi
+
+# Modifying owner
+chown -R apacheds:apacheds $APACHEDS_HOME_DIRECTORY
+chown -R apacheds:apacheds $INSTANCES_HOME_DIRECTORY
+chown apacheds:apacheds /var/run/apacheds-$APACHEDS_VERSION
+chown root:root /etc/init.d/apacheds-$APACHEDS_VERSION-$DEFAULT_INSTANCE_NAME

Modified: directory/sandbox/pamarcelot/trunks/apacheds-additional-installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/deb/apacheds-init
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/trunks/apacheds-additional-installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/deb/apacheds-init?rev=643331&r1=643330&r2=643331&view=diff
==============================================================================
--- directory/sandbox/pamarcelot/trunks/apacheds-additional-installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/deb/apacheds-init
(original)
+++ directory/sandbox/pamarcelot/trunks/apacheds-additional-installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/deb/apacheds-init
Tue Apr  1 02:18:15 2008
@@ -405,8 +405,7 @@
 }
 
 usage() {
-    echo "Please enter an instance name..."
-    echo "Usage: $0 <command> <instance name>"
+    echo "Usage: $0 <command>"
     echo "  Available Commands: "
     echo "      console     - Run in interactive mode with log output to the console."
     echo "                    Press CTRL-C to stop."
@@ -586,7 +585,7 @@
         ;;
 
     *)
-        echo "Usage: $0 { console | start | stop | restart | status | dump } <instance
name>"
+        echo "Usage: $0 { console | start | stop | restart | status | dump }"
         exit 1
         ;;
 esac

Modified: directory/sandbox/pamarcelot/trunks/apacheds-additional-installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/deb/postinst
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/trunks/apacheds-additional-installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/deb/postinst?rev=643331&r1=643330&r2=643331&view=diff
==============================================================================
--- directory/sandbox/pamarcelot/trunks/apacheds-additional-installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/deb/postinst
(original)
+++ directory/sandbox/pamarcelot/trunks/apacheds-additional-installers/daemon/plugin/src/main/resources/org/apache/directory/daemon/installers/deb/postinst
Tue Apr  1 02:18:15 2008
@@ -5,6 +5,14 @@
 chmod +x /opt/apacheds-${app.version}/bin/apacheds
 chmod +x /etc/init.d/apacheds-${app.version}-default
 
+# Creating the apacheds user (only if needed)
+USER=`eval "id -u -n apacheds 2>/dev/null || :"`
+if [ ! "Xapacheds" = "X$USER" ]
+then
+	/usr/sbin/groupadd apacheds >/dev/null 2>&1 || :
+	/usr/sbin/useradd -g apacheds -d /opt/apacheds-${app.version} apacheds >/dev/null 2>&1
|| :
+fi
+
 # Modifying owner
 chown -R apacheds:apacheds /opt/apacheds-${app.version}
 chown -R apacheds:apacheds /var/lib/apacheds-${app.version}



Mime
View raw message