You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2012/04/03 04:03:57 UTC

svn commit: r1308650 - /ofbiz/trunk/tools/rc.ofbiz.for.ubuntu

Author: hansbak
Date: Tue Apr  3 02:03:57 2012
New Revision: 1308650

URL: http://svn.apache.org/viewvc?rev=1308650&view=rev
Log:
startup script improvements

Modified:
    ofbiz/trunk/tools/rc.ofbiz.for.ubuntu

Modified: ofbiz/trunk/tools/rc.ofbiz.for.ubuntu
URL: http://svn.apache.org/viewvc/ofbiz/trunk/tools/rc.ofbiz.for.ubuntu?rev=1308650&r1=1308649&r2=1308650&view=diff
==============================================================================
--- ofbiz/trunk/tools/rc.ofbiz.for.ubuntu (original)
+++ ofbiz/trunk/tools/rc.ofbiz.for.ubuntu Tue Apr  3 02:03:57 2012
@@ -32,14 +32,18 @@ OFBIZDIR="ofbiz"
 
 # Start OFBiz
 start() {
+    if [ "$USER" = "" ]; then
+        echo "Mounting data disk at boottime here"
+#        mount /dev/sdg /data
+    fi
     running
     if [ "$OFBIZ_PROCS" = "" ]; then
         echo "Ofbiz is already running..."
         return 0
     fi
     if [ "$USER" = "$OFBIZUSER" ]; then
-        echo "starting standard ~/$OFBIZDIR/startofbiz.sh"
-        cd ~/$OFBIZDIR
+        echo "starting standard /home/$OFBIZUSER/$OFBIZDIR/startofbiz.sh"
+        cd /home/$OFBIZUSER/$OFBIZDIR
         ./startofbiz.sh
         if [ $? = 0 ]; then 
             echo "start success"
@@ -53,7 +57,7 @@ start() {
 stop() {
     if [ "$USER" = "$OFBIZUSER" ]; then
         echo "stopping standard /home/$OFBIZUSER/$OFBIZDIR/stopofbiz.sh"
-        cd ~/$OFBIZDIR
+        cd /home/$OFBIZUSER/$OFBIZDIR
 	    MAXCOUNT=10
         COUNTER=0
         until [ $COUNTER -gt $MAXCOUNT ]; do
@@ -76,8 +80,6 @@ stop() {
 checkUser() {
     if [ "$USER" != "$OFBIZUSER" ]; then
         if [ "$USER" = "" ]; then
-#           echo "Mounting data disk at boot"
-#           mount /dev/sdf /backup 
             exec su - $OFBIZUSER -c "$0 $1 "
 	    else
 	        exec sudo -u $OFBIZUSER $0 $1 



Re: svn commit: r1308650 - /ofbiz/trunk/tools/rc.ofbiz.for.ubuntu

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
Hans,

could you please already take care of using the files in the tools folder? I could do this but I would not be able to test and since it seems you are already on it it maybe easier for you.

Thanks

Jacopo

On Apr 3, 2012, at 9:12 AM, Nicolas Malin wrote:

> Hi hans,
> 
> Just some suggests
> 
>> @@ -32,14 +32,18 @@ OFBIZDIR="ofbiz"
>> 
>>  # Start OFBiz
>>  start() {
>> +    if [ "$USER" = "" ]; then
>> +        echo "Mounting data disk at boottime here"
>> +#        mount /dev/sdg /data
>> +    fi
> It's not a specific server configuration ?
> 
>>      running
>>      if [ "$OFBIZ_PROCS" = "" ]; then
>>          echo "Ofbiz is already running..."
>>          return 0
>>      fi
>>      if [ "$USER" = "$OFBIZUSER" ]; then
>> -        echo "starting standard ~/$OFBIZDIR/startofbiz.sh"
>> -        cd ~/$OFBIZDIR
>> +        echo "starting standard /home/$OFBIZUSER/$OFBIZDIR/startofbiz.sh"
>> +        cd /home/$OFBIZUSER/$OFBIZDIR
> I propose to replace "/home/$OFBIZUSER/$OFBIZDIR" by
> OFBIZ_LOCATION = "/home/$OFBIZUSER/$OFBIZDIR"
> and use like :
> cd $OFBIZ_LOCATION
> 
> It's will be easier to change the ofbiz location especially if you have various ofbiz on same server ;)
> 
> Nicolas
> 
> -- 
> Nicolas MALIN
> Consultant
> Tél : 06.17.66.40.06
> Site projet : http://www.neogia.org/
> -------
> Société LibrenBerry
> Tél : 02.48.02.56.12
> Site : http://www.librenberry.net/
> 


Re: svn commit: r1308650 - /ofbiz/trunk/tools/rc.ofbiz.for.ubuntu

Posted by Nicolas Malin <ma...@librenberry.net>.
Le 03/04/2012 09:51, Hans Bakker a écrit :
> Hi Nicolas,
>
> thanks you for your comments. see below
>
> On 04/03/2012 02:12 PM, Nicolas Malin wrote:
>> Hi hans,
>>
>> Just some suggests
>>
>>> @@ -32,14 +32,18 @@ OFBIZDIR="ofbiz"
>>>
>>>   # Start OFBiz
>>>   start() {
>>> +    if [ "$USER" = "" ]; then
>>> +        echo "Mounting data disk at boottime here"
>>> +#        mount /dev/sdg /data
>>> +    fi
>> It's not a specific server configuration ?
>>
> that is why the mount is commented out.
> On amazon EC2 you have to mount your external disks before they can be 
> used.
Ok I understand, I propose :
+#    # Uncomment for cloud configuration
+#    if [ "$USER" = "" ]; then
+#     echo "Mounting data disk at boottime here"
+#     mount /dev/sdg /data
+#   fi

>>>       running
>>>       if [ "$OFBIZ_PROCS" = "" ]; then
>>>           echo "Ofbiz is already running..."
>>>           return 0
>>>       fi
>>>       if [ "$USER" = "$OFBIZUSER" ]; then
>>> -        echo "starting standard ~/$OFBIZDIR/startofbiz.sh"
>>> -        cd ~/$OFBIZDIR
>>> +        echo "starting standard 
>>> /home/$OFBIZUSER/$OFBIZDIR/startofbiz.sh"
>>> +        cd /home/$OFBIZUSER/$OFBIZDIR
>> I propose to replace "/home/$OFBIZUSER/$OFBIZDIR" by
>> OFBIZ_LOCATION = "/home/$OFBIZUSER/$OFBIZDIR"
>> and use like :
>> cd $OFBIZ_LOCATION
>>
>> It's will be easier to change the ofbiz location especially if you 
>> have various ofbiz on same server ;)
>>
> user and ofbiz drectoiry are both important:
>
> 1. OFBIZUSER is the user running the instance and should be tested if 
> the script is running as the user
> 2. OFBIZDIR is the directory of that specific user
Right, my suggest isn't to remove these variable but just concat  the 
location.

> if you run more than one instance, you should run them under different 
> users.
Why, it's a politic system architecture not a best practice. Some system 
administrator prefer deploy on one user. If the script manage different 
solution, it will be even more used :)

Nicolas
>
>> Nicolas
>>
>


-- 
Nicolas MALIN
Consultant
Tél : 06.17.66.40.06
Site projet : http://www.neogia.org/
-------
Société LibrenBerry
Tél : 02.48.02.56.12
Site : http://www.librenberry.net/


Re: svn commit: r1308650 - /ofbiz/trunk/tools/rc.ofbiz.for.ubuntu

Posted by Hans Bakker <ma...@antwebsystems.com>.
Hi Nicolas,

thanks you for your comments. see below

On 04/03/2012 02:12 PM, Nicolas Malin wrote:
> Hi hans,
>
> Just some suggests
>
>> @@ -32,14 +32,18 @@ OFBIZDIR="ofbiz"
>>
>>   # Start OFBiz
>>   start() {
>> +    if [ "$USER" = "" ]; then
>> +        echo "Mounting data disk at boottime here"
>> +#        mount /dev/sdg /data
>> +    fi
> It's not a specific server configuration ?
>
that is why the mount is commented out.
On amazon EC2 you have to mount your external disks before they can be used.
>>       running
>>       if [ "$OFBIZ_PROCS" = "" ]; then
>>           echo "Ofbiz is already running..."
>>           return 0
>>       fi
>>       if [ "$USER" = "$OFBIZUSER" ]; then
>> -        echo "starting standard ~/$OFBIZDIR/startofbiz.sh"
>> -        cd ~/$OFBIZDIR
>> +        echo "starting standard 
>> /home/$OFBIZUSER/$OFBIZDIR/startofbiz.sh"
>> +        cd /home/$OFBIZUSER/$OFBIZDIR
> I propose to replace "/home/$OFBIZUSER/$OFBIZDIR" by
> OFBIZ_LOCATION = "/home/$OFBIZUSER/$OFBIZDIR"
> and use like :
> cd $OFBIZ_LOCATION
>
> It's will be easier to change the ofbiz location especially if you 
> have various ofbiz on same server ;)
>
user and ofbiz drectoiry are both important:

1. OFBIZUSER is the user running the instance and should be tested if 
the script is running as the user
2. OFBIZDIR is the directory of that specific user

if you run more than one instance, you should run them under different 
users.

> Nicolas
>


Re: svn commit: r1308650 - /ofbiz/trunk/tools/rc.ofbiz.for.ubuntu

Posted by Nicolas Malin <ma...@librenberry.net>.
Hi hans,

Just some suggests

> @@ -32,14 +32,18 @@ OFBIZDIR="ofbiz"
>
>   # Start OFBiz
>   start() {
> +    if [ "$USER" = "" ]; then
> +        echo "Mounting data disk at boottime here"
> +#        mount /dev/sdg /data
> +    fi
It's not a specific server configuration ?

>       running
>       if [ "$OFBIZ_PROCS" = "" ]; then
>           echo "Ofbiz is already running..."
>           return 0
>       fi
>       if [ "$USER" = "$OFBIZUSER" ]; then
> -        echo "starting standard ~/$OFBIZDIR/startofbiz.sh"
> -        cd ~/$OFBIZDIR
> +        echo "starting standard /home/$OFBIZUSER/$OFBIZDIR/startofbiz.sh"
> +        cd /home/$OFBIZUSER/$OFBIZDIR
I propose to replace "/home/$OFBIZUSER/$OFBIZDIR" by
OFBIZ_LOCATION = "/home/$OFBIZUSER/$OFBIZDIR"
and use like :
cd $OFBIZ_LOCATION

It's will be easier to change the ofbiz location especially if you have 
various ofbiz on same server ;)

Nicolas

-- 
Nicolas MALIN
Consultant
Tél : 06.17.66.40.06
Site projet : http://www.neogia.org/
-------
Société LibrenBerry
Tél : 02.48.02.56.12
Site : http://www.librenberry.net/