directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r750443 - in /directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin: apacheds-init install.sh variables.sh
Date Thu, 05 Mar 2009 12:42:20 GMT
Author: pamarcelot
Date: Thu Mar  5 12:42:19 2009
New Revision: 750443

URL: http://svn.apache.org/viewvc?rev=750443&view=rev
Log:
Fix for DIRSERVER-1318 (Binary installer does not allow installation with a simple user).

Modified:
    directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/apacheds-init
    directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/install.sh
    directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/variables.sh

Modified: directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/apacheds-init
URL: http://svn.apache.org/viewvc/directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/apacheds-init?rev=750443&r1=750442&r2=750443&view=diff
==============================================================================
--- directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/apacheds-init
(original)
+++ directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/apacheds-init
Thu Mar  5 12:42:19 2009
@@ -46,7 +46,7 @@
 PRIORITY=
 
 # Location of the pid file.
-PIDDIR="/var/run/@app@-@app.version@"
+PIDDIR="@INSTANCE.HOME@/@INSTANCE@/run"
 
 # 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,7 +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=@RUN_AS_USER@
 
 # Do not modify anything beyond this point
 #-----------------------------------------------------------------------------
@@ -415,7 +415,7 @@
 	then
 		# If it doesn't exist, we create it
    		mkdir -p $PIDDIR
-   		chown apacheds:apacheds $PIDDIR
+   		chown $RUN_AS_USER:$RUN_AS_USER $PIDDIR
 	fi
 }
 

Modified: directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/install.sh
URL: http://svn.apache.org/viewvc/directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/install.sh?rev=750443&r1=750442&r2=750443&view=diff
==============================================================================
--- directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/install.sh
(original)
+++ directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/install.sh
Thu Mar  5 12:42:19 2009
@@ -71,10 +71,6 @@
 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 ../rootFolder/instance/apacheds.conf $DEFAULT_INSTANCE_HOME_DIRECTORY/conf/
 verifyExitCode
@@ -96,27 +92,30 @@
 verifyExitCode
 mv ../rootFolder/instance/apacheds-init.tmp ../rootFolder/instance/apacheds-init
 verifyExitCode
-cp ../rootFolder/instance/apacheds-init /etc/init.d/apacheds-$APACHEDS_VERSION-$DEFAULT_INSTANCE_NAME
+sed -e "s;@RUN_AS_USER@;${RUN_AS_USER};" ../rootFolder/instance/apacheds-init > ../rootFolder/instance/apacheds-init.tmp
+verifyExitCode
+mv ../rootFolder/instance/apacheds-init.tmp ../rootFolder/instance/apacheds-init
+verifyExitCode
+cp ../rootFolder/instance/apacheds-init $STARTUP_SCRIPT_DIRECTORY/apacheds-$APACHEDS_VERSION-$DEFAULT_INSTANCE_NAME
 verifyExitCode
 
 # Setting the correct permissions on executable files
-chmod +x /etc/init.d/apacheds-$APACHEDS_VERSION-$DEFAULT_INSTANCE_NAME
+chmod +x $STARTUP_SCRIPT_DIRECTORY/apacheds-$APACHEDS_VERSION-$DEFAULT_INSTANCE_NAME
 verifyExitCode
 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" ]
+USER=`eval "id -u -n $RUN_AS_USER"`
+if [ ! "X$RUN_AS_USER" = "X$USER" ]
 then
-	/usr/sbin/groupadd apacheds >/dev/null 2>&1 || :
+	/usr/sbin/groupadd $RUN_AS_USER >/dev/null 2>&1 || :
 	verifyExitCode
-	/usr/sbin/useradd -g apacheds -d $APACHEDS_HOME_DIRECTORY apacheds >/dev/null 2>&1
|| :
+	/usr/sbin/useradd -g $RUN_AS_USER -d $APACHEDS_HOME_DIRECTORY $RUN_AS_USER >/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
+chown -R $RUN_AS_USER:$RUN_AS_USER $APACHEDS_HOME_DIRECTORY
+chown -R $RUN_AS_USER:$RUN_AS_USER $INSTANCES_HOME_DIRECTORY
+chown $RUN_AS_USER:$RUN_AS_USER $STARTUP_SCRIPT_DIRECTORY/apacheds-$APACHEDS_VERSION-$DEFAULT_INSTANCE_NAME

Modified: directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/variables.sh
URL: http://svn.apache.org/viewvc/directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/variables.sh?rev=750443&r1=750442&r2=750443&view=diff
==============================================================================
--- directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/variables.sh
(original)
+++ directory/daemon/trunk/plugin/src/main/resources/org/apache/directory/daemon/installers/bin/variables.sh
Thu Mar  5 12:42:19 2009
@@ -20,3 +20,5 @@
 Where do you want to install Apache DS|APACHEDS_HOME_DIRECTORY|/opt/apacheds-${APACHEDS_VERSION}||
 Where do you want to install Apache DS instances|INSTANCES_HOME_DIRECTORY|/var/lib/apacheds-${APACHEDS_VERSION}||
 What name do you want for the default instance|DEFAULT_INSTANCE_NAME|default||
+Where do you want to install the startup script|STARTUP_SCRIPT_DIRECTORY|/etc/init.d||
+Which user do you want to run the server with (if not already existing, the specified user
will be created)|RUN_AS_USER|apacheds||



Mime
View raw message