Re: [Dev] Running script commands after wso2server.sh is executed in a single script file

2014-06-07 Thread Udara Liyanage
Hi,

Yes port open can be thought server is up and running.
This is how sever running is identified in Stratos too.


Touched, not typed. Erroneous words are a feature, not a typo.
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Running script commands after wso2server.sh is executed in a single script file

2014-06-02 Thread Krishantha Samaraweera
Hi Chris,

Although the port is open it doesn't guarantee that the server is in full
operational mode. When running automated tests, we do two things to verify
the server is fully started.

1. Wait for port to open.
2. Wait for user login.

As per my observations, there is 4ms delay between port opening and
successful login. So we ignore the fail login attempts withing this 4ms
range and wait for successful login to take place before proceed with any
tests.

Thanks,
Krishantha.


On Mon, Jun 2, 2014 at 2:57 PM, chris snow  wrote:

> Hi Krishantha.   This is really useful.
>
> Does it guarantee that  the wso2 server has fully started?
>
> On Mon, Jun 2, 2014 at 10:03 AM, Krishantha Samaraweera
>  wrote:
> >
> > Hi,
> >
> > On Mon, Jun 2, 2014 at 2:23 PM, Sajini De Silva  wrote:
> >>
> >> Hi,
> >>
> >> Thank you for the quick reply chirs.
> >>
> >> I figured out that this is happening because wso2server.sh command does
> >> not release the terminal. Therefore i edited the code like below and
> now its
> >> working.
> >>
> >> sh ./wso2server.sh &
> >> sleep 20
> >>
> >> echo "The script exited with status $?"
> >> [ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd`
> >> echo $CARBON_HOME
> >> sh ./checkin-client.sh co https://localhost:9445/registry -u admin -p
> >> admin
> >>
> >> cp $CARBON_HOME/repository/cloud/profile1
> >> _system/config/bamServerProfiles/
> >> cp $CARBON_HOME/repository/cloud/oidlist.txt _system/governance/
> >> sh ./checkin-client.sh add _system/config/bamServerProfiles/profile1
> >> sh ./checkin-client.sh add _system/governance/oidlist.txt
> >> sh ./checkin-client.sh ci -u admin -p admin
> >>
> >>
> >> Does anyone know another way of doing this without having the sleep
> >> command?
> >
> >
> > Wait for the port to open would help
> >
> > while ! echo exit | nc localhost 9445; do sleep 10; done
> >
> > Thanks,
> > Krishantha.
> >>
> >>
> >> Thank you,
> >> Sajini.
> >>
> >>
> >>
> >> On Mon, Jun 2, 2014 at 2:02 PM, chris snow  wrote:
> >>>
> >>> What command in the wso2server.sh script failing?  You could use the
> >>> '-x' flag to debug:
> >>>
> >>> ...
> >>>
> >>> CMD="$CMD -Desb.sample=cloud
> >>> -Dcarbon.registry.root=../cloud/esb-samples/scloud"
> >>> #sh $PRGDIR/wso2server.sh$CMD
> >>> bash -x ./wso2server.sh
> >>>
> >>> echo "The script exited with status $?"
> >>> ...
> >>>
> >>>
> >>>
> >>>
> >>> On Mon, Jun 2, 2014 at 9:13 AM, Sajini De Silva 
> wrote:
> >>> > Hi,
> >>> >
> >>> > This is what my script file looks like,
> >>> >
> >>> > PRG="$0"
> >>> >
> >>> > while [ -h "$PRG" ]; do
> >>> > echo $PRG
> >>> >   ls=`ls -ld "$PRG"`
> >>> >   link=`expr "$ls" : '.*-> \(.*\)$'`
> >>> >   if expr "$link" : '.*/.*' > /dev/null; then
> >>> > PRG="$link"
> >>> >   else
> >>> > PRG=`dirname "$PRG"`/"$link"
> >>> >   fi
> >>> > done
> >>> >
> >>> > # Get standard environment variables
> >>> > PRGDIR=`dirname "$PRG"`
> >>> >
> >>> > # - Process the input command
> >>> > --
> >>> > CMD=""
> >>> >
> >>> >  CMD="$CMD -Desb.sample=cloud
> >>> > -Dcarbon.registry.root=../cloud/esb-samples/scloud"
> >>> > #sh $PRGDIR/wso2server.sh$CMD
> >>> > sh ./wso2server.sh
> >>> > echo "The script exited with status $?"
> >>> > [ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd`
> >>> > echo $CARBON_HOME
> >>> > sh ./checkin-client.sh co https://localhost:9445/registry -u admin
> -p
> >>> > admin
> >>> >
> >>> > cp $CARBON_HOME/repository/cloud/profile1
> >>> > _system/config/bamServerProfiles/
> >>> > cp $CARBON_HOME/repository/cloud/oidlist.txt _system/governance/
> >>> > sh ./checkin-client.sh add _system/config/bamServerProfiles/profile1
> >>> > sh ./checkin-client.sh add _system/governance/oidlist.txt
> >>> > sh ./checkin-client.sh ci -u admin -p admin
> >>> >
> >>> >
> >>> >
> >>> > On Mon, Jun 2, 2014 at 1:36 PM, Sajini De Silva 
> >>> > wrote:
> >>> >>
> >>> >> Hi,
> >>> >>
> >>> >> I want to start the esb server from a script file and execute some
> >>> >> check-in client commands from the same script, but once
> wso2server.sh
> >>> >> is
> >>> >> executed in the script it never return to the next line where other
> >>> >> script
> >>> >> commands are placed. Therefore my other script commands are not
> >>> >> executed.
> >>> >>
> >>> >> Any suggestions on why it is happening?
> >>> >>
> >>> >> Thank you,
> >>> >> Sajini.
> >>> >> --
> >>> >> Sajini De SIlva
> >>> >> Software Engineer; WSO2 Inc.; http://wso2.com ,
> >>> >> Email: saj...@wso2.com
> >>> >> Blog: http://sajinid.blogspot.com/
> >>> >> Git hub profile: https://github.com/sajinidesilva
> >>> >>
> >>> >
> >>> >
> >>> >
> >>> > --
> >>> > Sajini De SIlva
> >>> > Software Engineer; WSO2 Inc.; http://wso2.com ,
> >>> > Email: saj...@wso2.com
> >>> > Blog: http://sajinid.blogspot.com/
> >>> > Git hub profile: https://github.com/sajinidesilva
> >>> >
> >>> >
> >>> > ___
> >>> > Dev mailing list
> >>> > Dev@wso2.org
> >>> > 

Re: [Dev] Running script commands after wso2server.sh is executed in a single script file

2014-06-02 Thread chris snow
Hi Krishantha.   This is really useful.

Does it guarantee that  the wso2 server has fully started?

On Mon, Jun 2, 2014 at 10:03 AM, Krishantha Samaraweera
 wrote:
>
> Hi,
>
> On Mon, Jun 2, 2014 at 2:23 PM, Sajini De Silva  wrote:
>>
>> Hi,
>>
>> Thank you for the quick reply chirs.
>>
>> I figured out that this is happening because wso2server.sh command does
>> not release the terminal. Therefore i edited the code like below and now its
>> working.
>>
>> sh ./wso2server.sh &
>> sleep 20
>>
>> echo "The script exited with status $?"
>> [ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd`
>> echo $CARBON_HOME
>> sh ./checkin-client.sh co https://localhost:9445/registry -u admin -p
>> admin
>>
>> cp $CARBON_HOME/repository/cloud/profile1
>> _system/config/bamServerProfiles/
>> cp $CARBON_HOME/repository/cloud/oidlist.txt _system/governance/
>> sh ./checkin-client.sh add _system/config/bamServerProfiles/profile1
>> sh ./checkin-client.sh add _system/governance/oidlist.txt
>> sh ./checkin-client.sh ci -u admin -p admin
>>
>>
>> Does anyone know another way of doing this without having the sleep
>> command?
>
>
> Wait for the port to open would help
>
> while ! echo exit | nc localhost 9445; do sleep 10; done
>
> Thanks,
> Krishantha.
>>
>>
>> Thank you,
>> Sajini.
>>
>>
>>
>> On Mon, Jun 2, 2014 at 2:02 PM, chris snow  wrote:
>>>
>>> What command in the wso2server.sh script failing?  You could use the
>>> '-x' flag to debug:
>>>
>>> ...
>>>
>>> CMD="$CMD -Desb.sample=cloud
>>> -Dcarbon.registry.root=../cloud/esb-samples/scloud"
>>> #sh $PRGDIR/wso2server.sh$CMD
>>> bash -x ./wso2server.sh
>>>
>>> echo "The script exited with status $?"
>>> ...
>>>
>>>
>>>
>>>
>>> On Mon, Jun 2, 2014 at 9:13 AM, Sajini De Silva  wrote:
>>> > Hi,
>>> >
>>> > This is what my script file looks like,
>>> >
>>> > PRG="$0"
>>> >
>>> > while [ -h "$PRG" ]; do
>>> > echo $PRG
>>> >   ls=`ls -ld "$PRG"`
>>> >   link=`expr "$ls" : '.*-> \(.*\)$'`
>>> >   if expr "$link" : '.*/.*' > /dev/null; then
>>> > PRG="$link"
>>> >   else
>>> > PRG=`dirname "$PRG"`/"$link"
>>> >   fi
>>> > done
>>> >
>>> > # Get standard environment variables
>>> > PRGDIR=`dirname "$PRG"`
>>> >
>>> > # - Process the input command
>>> > --
>>> > CMD=""
>>> >
>>> >  CMD="$CMD -Desb.sample=cloud
>>> > -Dcarbon.registry.root=../cloud/esb-samples/scloud"
>>> > #sh $PRGDIR/wso2server.sh$CMD
>>> > sh ./wso2server.sh
>>> > echo "The script exited with status $?"
>>> > [ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd`
>>> > echo $CARBON_HOME
>>> > sh ./checkin-client.sh co https://localhost:9445/registry -u admin -p
>>> > admin
>>> >
>>> > cp $CARBON_HOME/repository/cloud/profile1
>>> > _system/config/bamServerProfiles/
>>> > cp $CARBON_HOME/repository/cloud/oidlist.txt _system/governance/
>>> > sh ./checkin-client.sh add _system/config/bamServerProfiles/profile1
>>> > sh ./checkin-client.sh add _system/governance/oidlist.txt
>>> > sh ./checkin-client.sh ci -u admin -p admin
>>> >
>>> >
>>> >
>>> > On Mon, Jun 2, 2014 at 1:36 PM, Sajini De Silva 
>>> > wrote:
>>> >>
>>> >> Hi,
>>> >>
>>> >> I want to start the esb server from a script file and execute some
>>> >> check-in client commands from the same script, but once wso2server.sh
>>> >> is
>>> >> executed in the script it never return to the next line where other
>>> >> script
>>> >> commands are placed. Therefore my other script commands are not
>>> >> executed.
>>> >>
>>> >> Any suggestions on why it is happening?
>>> >>
>>> >> Thank you,
>>> >> Sajini.
>>> >> --
>>> >> Sajini De SIlva
>>> >> Software Engineer; WSO2 Inc.; http://wso2.com ,
>>> >> Email: saj...@wso2.com
>>> >> Blog: http://sajinid.blogspot.com/
>>> >> Git hub profile: https://github.com/sajinidesilva
>>> >>
>>> >
>>> >
>>> >
>>> > --
>>> > Sajini De SIlva
>>> > Software Engineer; WSO2 Inc.; http://wso2.com ,
>>> > Email: saj...@wso2.com
>>> > Blog: http://sajinid.blogspot.com/
>>> > Git hub profile: https://github.com/sajinidesilva
>>> >
>>> >
>>> > ___
>>> > Dev mailing list
>>> > Dev@wso2.org
>>> > http://wso2.org/cgi-bin/mailman/listinfo/dev
>>> >
>>>
>>>
>>>
>>> --
>>> Check out my professional profile and connect with me on LinkedIn.
>>> http://lnkd.in/cw5k69
>>
>>
>>
>>
>> --
>> Sajini De SIlva
>> Software Engineer; WSO2 Inc.; http://wso2.com ,
>> Email: saj...@wso2.com
>> Blog: http://sajinid.blogspot.com/
>> Git hub profile: https://github.com/sajinidesilva
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>
>
>
> --
> Krishantha Samaraweera
> Senior Technical Lead - Test Automation
> Mobile: +94 77 7759918
> WSO2, Inc.; http://wso2.com/
> lean . enterprise . middlewear.
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>



-- 
Check out my professional

Re: [Dev] Running script commands after wso2server.sh is executed in a single script file

2014-06-02 Thread Sajini De Silva
Hi,

Thank you. It worked.

Thank you,
Sajini.


On Mon, Jun 2, 2014 at 2:33 PM, Krishantha Samaraweera 
wrote:

>
> Hi,
>
> On Mon, Jun 2, 2014 at 2:23 PM, Sajini De Silva  wrote:
>
>> Hi,
>>
>> Thank you for the quick reply chirs.
>>
>> I figured out that this is happening because wso2server.sh command does
>> not release the terminal. Therefore i edited the code like below and now
>> its working.
>>
>> sh ./wso2server.sh &
>> sleep 20
>>
>> echo "The script exited with status $?"
>> [ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd`
>> echo $CARBON_HOME
>> sh ./checkin-client.sh co https://localhost:9445/registry -u admin -p
>> admin
>>
>> cp $CARBON_HOME/repository/cloud/profile1
>> _system/config/bamServerProfiles/
>> cp $CARBON_HOME/repository/cloud/oidlist.txt _system/governance/
>> sh ./checkin-client.sh add _system/config/bamServerProfiles/profile1
>> sh ./checkin-client.sh add _system/governance/oidlist.txt
>> sh ./checkin-client.sh ci -u admin -p admin
>>
>>
>> Does anyone know another way of doing this without having the sleep
>> command?
>>
>
> Wait for the port to open would help
>
> while ! echo exit | nc localhost 9445; do sleep 10; done
>
> Thanks,
> Krishantha.
>
>>
>> Thank you,
>> Sajini.
>>
>>
>>
>> On Mon, Jun 2, 2014 at 2:02 PM, chris snow  wrote:
>>
>>> What command in the wso2server.sh script failing?  You could use the
>>> '-x' flag to debug:
>>>
>>> ...
>>>
>>> CMD="$CMD -Desb.sample=cloud
>>> -Dcarbon.registry.root=../cloud/esb-samples/scloud"
>>> #sh $PRGDIR/wso2server.sh$CMD
>>> bash -x ./wso2server.sh
>>>
>>> echo "The script exited with status $?"
>>> ...
>>>
>>>
>>>
>>>
>>> On Mon, Jun 2, 2014 at 9:13 AM, Sajini De Silva  wrote:
>>> > Hi,
>>> >
>>> > This is what my script file looks like,
>>> >
>>> > PRG="$0"
>>> >
>>> > while [ -h "$PRG" ]; do
>>> > echo $PRG
>>> >   ls=`ls -ld "$PRG"`
>>> >   link=`expr "$ls" : '.*-> \(.*\)$'`
>>> >   if expr "$link" : '.*/.*' > /dev/null; then
>>> > PRG="$link"
>>> >   else
>>> > PRG=`dirname "$PRG"`/"$link"
>>> >   fi
>>> > done
>>> >
>>> > # Get standard environment variables
>>> > PRGDIR=`dirname "$PRG"`
>>> >
>>> > # - Process the input command
>>> > --
>>> > CMD=""
>>> >
>>> >  CMD="$CMD -Desb.sample=cloud
>>> > -Dcarbon.registry.root=../cloud/esb-samples/scloud"
>>> > #sh $PRGDIR/wso2server.sh$CMD
>>> > sh ./wso2server.sh
>>> > echo "The script exited with status $?"
>>> > [ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd`
>>> > echo $CARBON_HOME
>>> > sh ./checkin-client.sh co https://localhost:9445/registry -u admin -p
>>> admin
>>> >
>>> > cp $CARBON_HOME/repository/cloud/profile1
>>> _system/config/bamServerProfiles/
>>> > cp $CARBON_HOME/repository/cloud/oidlist.txt _system/governance/
>>> > sh ./checkin-client.sh add _system/config/bamServerProfiles/profile1
>>> > sh ./checkin-client.sh add _system/governance/oidlist.txt
>>> > sh ./checkin-client.sh ci -u admin -p admin
>>> >
>>> >
>>> >
>>> > On Mon, Jun 2, 2014 at 1:36 PM, Sajini De Silva 
>>> wrote:
>>> >>
>>> >> Hi,
>>> >>
>>> >> I want to start the esb server from a script file and execute some
>>> >> check-in client commands from the same script, but once wso2server.sh
>>> is
>>> >> executed in the script it never return to the next line where other
>>> script
>>> >> commands are placed. Therefore my other script commands are not
>>> executed.
>>> >>
>>> >> Any suggestions on why it is happening?
>>> >>
>>> >> Thank you,
>>> >> Sajini.
>>> >> --
>>> >> Sajini De SIlva
>>> >> Software Engineer; WSO2 Inc.; http://wso2.com ,
>>> >> Email: saj...@wso2.com
>>> >> Blog: http://sajinid.blogspot.com/
>>> >> Git hub profile: https://github.com/sajinidesilva
>>> >>
>>> >
>>> >
>>> >
>>> > --
>>> > Sajini De SIlva
>>> > Software Engineer; WSO2 Inc.; http://wso2.com ,
>>> > Email: saj...@wso2.com
>>> > Blog: http://sajinid.blogspot.com/
>>> > Git hub profile: https://github.com/sajinidesilva
>>> >
>>> >
>>> > ___
>>> > Dev mailing list
>>> > Dev@wso2.org
>>> > http://wso2.org/cgi-bin/mailman/listinfo/dev
>>> >
>>>
>>>
>>>
>>> --
>>> Check out my professional profile and connect with me on LinkedIn.
>>> http://lnkd.in/cw5k69
>>>
>>
>>
>>
>> --
>> Sajini De SIlva
>> Software Engineer; WSO2 Inc.; http://wso2.com ,
>> Email: saj...@wso2.com
>> Blog: http://sajinid.blogspot.com/
>> Git hub profile: https://github.com/sajinidesilva
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Krishantha Samaraweera
> Senior Technical Lead - Test Automation
> Mobile: +94 77 7759918
> WSO2, Inc.; http://wso2.com/
> lean . enterprise . middlewear.
>



-- 
Sajini De SIlva
Software Engineer; WSO2 Inc.; http://wso2.com ,
Email: saj...@wso2.com
Blog: http://sajinid.blogspot.com/
Git hub profile: https://github.com/sajinidesilva
___
Dev m

Re: [Dev] Running script commands after wso2server.sh is executed in a single script file

2014-06-02 Thread Krishantha Samaraweera
Hi,

On Mon, Jun 2, 2014 at 2:23 PM, Sajini De Silva  wrote:

> Hi,
>
> Thank you for the quick reply chirs.
>
> I figured out that this is happening because wso2server.sh command does
> not release the terminal. Therefore i edited the code like below and now
> its working.
>
> sh ./wso2server.sh &
> sleep 20
>
> echo "The script exited with status $?"
> [ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd`
> echo $CARBON_HOME
> sh ./checkin-client.sh co https://localhost:9445/registry -u admin -p
> admin
>
> cp $CARBON_HOME/repository/cloud/profile1 _system/config/bamServerProfiles/
> cp $CARBON_HOME/repository/cloud/oidlist.txt _system/governance/
> sh ./checkin-client.sh add _system/config/bamServerProfiles/profile1
> sh ./checkin-client.sh add _system/governance/oidlist.txt
> sh ./checkin-client.sh ci -u admin -p admin
>
>
> Does anyone know another way of doing this without having the sleep
> command?
>

Wait for the port to open would help

while ! echo exit | nc localhost 9445; do sleep 10; done

Thanks,
Krishantha.

>
> Thank you,
> Sajini.
>
>
>
> On Mon, Jun 2, 2014 at 2:02 PM, chris snow  wrote:
>
>> What command in the wso2server.sh script failing?  You could use the
>> '-x' flag to debug:
>>
>> ...
>>
>> CMD="$CMD -Desb.sample=cloud
>> -Dcarbon.registry.root=../cloud/esb-samples/scloud"
>> #sh $PRGDIR/wso2server.sh$CMD
>> bash -x ./wso2server.sh
>>
>> echo "The script exited with status $?"
>> ...
>>
>>
>>
>>
>> On Mon, Jun 2, 2014 at 9:13 AM, Sajini De Silva  wrote:
>> > Hi,
>> >
>> > This is what my script file looks like,
>> >
>> > PRG="$0"
>> >
>> > while [ -h "$PRG" ]; do
>> > echo $PRG
>> >   ls=`ls -ld "$PRG"`
>> >   link=`expr "$ls" : '.*-> \(.*\)$'`
>> >   if expr "$link" : '.*/.*' > /dev/null; then
>> > PRG="$link"
>> >   else
>> > PRG=`dirname "$PRG"`/"$link"
>> >   fi
>> > done
>> >
>> > # Get standard environment variables
>> > PRGDIR=`dirname "$PRG"`
>> >
>> > # - Process the input command
>> > --
>> > CMD=""
>> >
>> >  CMD="$CMD -Desb.sample=cloud
>> > -Dcarbon.registry.root=../cloud/esb-samples/scloud"
>> > #sh $PRGDIR/wso2server.sh$CMD
>> > sh ./wso2server.sh
>> > echo "The script exited with status $?"
>> > [ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd`
>> > echo $CARBON_HOME
>> > sh ./checkin-client.sh co https://localhost:9445/registry -u admin -p
>> admin
>> >
>> > cp $CARBON_HOME/repository/cloud/profile1
>> _system/config/bamServerProfiles/
>> > cp $CARBON_HOME/repository/cloud/oidlist.txt _system/governance/
>> > sh ./checkin-client.sh add _system/config/bamServerProfiles/profile1
>> > sh ./checkin-client.sh add _system/governance/oidlist.txt
>> > sh ./checkin-client.sh ci -u admin -p admin
>> >
>> >
>> >
>> > On Mon, Jun 2, 2014 at 1:36 PM, Sajini De Silva 
>> wrote:
>> >>
>> >> Hi,
>> >>
>> >> I want to start the esb server from a script file and execute some
>> >> check-in client commands from the same script, but once wso2server.sh
>> is
>> >> executed in the script it never return to the next line where other
>> script
>> >> commands are placed. Therefore my other script commands are not
>> executed.
>> >>
>> >> Any suggestions on why it is happening?
>> >>
>> >> Thank you,
>> >> Sajini.
>> >> --
>> >> Sajini De SIlva
>> >> Software Engineer; WSO2 Inc.; http://wso2.com ,
>> >> Email: saj...@wso2.com
>> >> Blog: http://sajinid.blogspot.com/
>> >> Git hub profile: https://github.com/sajinidesilva
>> >>
>> >
>> >
>> >
>> > --
>> > Sajini De SIlva
>> > Software Engineer; WSO2 Inc.; http://wso2.com ,
>> > Email: saj...@wso2.com
>> > Blog: http://sajinid.blogspot.com/
>> > Git hub profile: https://github.com/sajinidesilva
>> >
>> >
>> > ___
>> > Dev mailing list
>> > Dev@wso2.org
>> > http://wso2.org/cgi-bin/mailman/listinfo/dev
>> >
>>
>>
>>
>> --
>> Check out my professional profile and connect with me on LinkedIn.
>> http://lnkd.in/cw5k69
>>
>
>
>
> --
> Sajini De SIlva
> Software Engineer; WSO2 Inc.; http://wso2.com ,
> Email: saj...@wso2.com
> Blog: http://sajinid.blogspot.com/
> Git hub profile: https://github.com/sajinidesilva
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Krishantha Samaraweera
Senior Technical Lead - Test Automation
Mobile: +94 77 7759918
WSO2, Inc.; http://wso2.com/
lean . enterprise . middlewear.
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Running script commands after wso2server.sh is executed in a single script file

2014-06-02 Thread Sajini De Silva
Hi,

Thank you for the quick reply chirs.

I figured out that this is happening because wso2server.sh command does not
release the terminal. Therefore i edited the code like below and now its
working.

sh ./wso2server.sh &
sleep 20
echo "The script exited with status $?"
[ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd`
echo $CARBON_HOME
sh ./checkin-client.sh co https://localhost:9445/registry -u admin -p admin

cp $CARBON_HOME/repository/cloud/profile1 _system/config/bamServerProfiles/
cp $CARBON_HOME/repository/cloud/oidlist.txt _system/governance/
sh ./checkin-client.sh add _system/config/bamServerProfiles/profile1
sh ./checkin-client.sh add _system/governance/oidlist.txt
sh ./checkin-client.sh ci -u admin -p admin


Does anyone know another way of doing this without having the sleep command?

Thank you,
Sajini.



On Mon, Jun 2, 2014 at 2:02 PM, chris snow  wrote:

> What command in the wso2server.sh script failing?  You could use the
> '-x' flag to debug:
>
> ...
> CMD="$CMD -Desb.sample=cloud
> -Dcarbon.registry.root=../cloud/esb-samples/scloud"
> #sh $PRGDIR/wso2server.sh$CMD
> bash -x ./wso2server.sh
> echo "The script exited with status $?"
> ...
>
>
>
> On Mon, Jun 2, 2014 at 9:13 AM, Sajini De Silva  wrote:
> > Hi,
> >
> > This is what my script file looks like,
> >
> > PRG="$0"
> >
> > while [ -h "$PRG" ]; do
> > echo $PRG
> >   ls=`ls -ld "$PRG"`
> >   link=`expr "$ls" : '.*-> \(.*\)$'`
> >   if expr "$link" : '.*/.*' > /dev/null; then
> > PRG="$link"
> >   else
> > PRG=`dirname "$PRG"`/"$link"
> >   fi
> > done
> >
> > # Get standard environment variables
> > PRGDIR=`dirname "$PRG"`
> >
> > # - Process the input command
> > --
> > CMD=""
> >
> >  CMD="$CMD -Desb.sample=cloud
> > -Dcarbon.registry.root=../cloud/esb-samples/scloud"
> > #sh $PRGDIR/wso2server.sh$CMD
> > sh ./wso2server.sh
> > echo "The script exited with status $?"
> > [ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd`
> > echo $CARBON_HOME
> > sh ./checkin-client.sh co https://localhost:9445/registry -u admin -p
> admin
> >
> > cp $CARBON_HOME/repository/cloud/profile1
> _system/config/bamServerProfiles/
> > cp $CARBON_HOME/repository/cloud/oidlist.txt _system/governance/
> > sh ./checkin-client.sh add _system/config/bamServerProfiles/profile1
> > sh ./checkin-client.sh add _system/governance/oidlist.txt
> > sh ./checkin-client.sh ci -u admin -p admin
> >
> >
> >
> > On Mon, Jun 2, 2014 at 1:36 PM, Sajini De Silva  wrote:
> >>
> >> Hi,
> >>
> >> I want to start the esb server from a script file and execute some
> >> check-in client commands from the same script, but once wso2server.sh is
> >> executed in the script it never return to the next line where other
> script
> >> commands are placed. Therefore my other script commands are not
> executed.
> >>
> >> Any suggestions on why it is happening?
> >>
> >> Thank you,
> >> Sajini.
> >> --
> >> Sajini De SIlva
> >> Software Engineer; WSO2 Inc.; http://wso2.com ,
> >> Email: saj...@wso2.com
> >> Blog: http://sajinid.blogspot.com/
> >> Git hub profile: https://github.com/sajinidesilva
> >>
> >
> >
> >
> > --
> > Sajini De SIlva
> > Software Engineer; WSO2 Inc.; http://wso2.com ,
> > Email: saj...@wso2.com
> > Blog: http://sajinid.blogspot.com/
> > Git hub profile: https://github.com/sajinidesilva
> >
> >
> > ___
> > Dev mailing list
> > Dev@wso2.org
> > http://wso2.org/cgi-bin/mailman/listinfo/dev
> >
>
>
>
> --
> Check out my professional profile and connect with me on LinkedIn.
> http://lnkd.in/cw5k69
>



-- 
Sajini De SIlva
Software Engineer; WSO2 Inc.; http://wso2.com ,
Email: saj...@wso2.com
Blog: http://sajinid.blogspot.com/
Git hub profile: https://github.com/sajinidesilva
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Running script commands after wso2server.sh is executed in a single script file

2014-06-02 Thread Sajini De Silva
Hi,

This is what my script file looks like,

PRG="$0"

while [ -h "$PRG" ]; do
echo $PRG
  ls=`ls -ld "$PRG"`
  link=`expr "$ls" : '.*-> \(.*\)$'`
  if expr "$link" : '.*/.*' > /dev/null; then
PRG="$link"
  else
PRG=`dirname "$PRG"`/"$link"
  fi
done

# Get standard environment variables
PRGDIR=`dirname "$PRG"`

# - Process the input command
--
CMD=""

 CMD="$CMD -Desb.sample=cloud
-Dcarbon.registry.root=../cloud/esb-samples/scloud"
#sh $PRGDIR/wso2server.sh$CMD
sh ./wso2server.sh
echo "The script exited with status $?"
[ -z "$CARBON_HOME" ] && CARBON_HOME=`cd "$PRGDIR/.." ; pwd`
echo $CARBON_HOME
sh ./checkin-client.sh co https://localhost:9445/registry -u admin -p admin

cp $CARBON_HOME/repository/cloud/profile1 _system/config/bamServerProfiles/
cp $CARBON_HOME/repository/cloud/oidlist.txt _system/governance/
sh ./checkin-client.sh add _system/config/bamServerProfiles/profile1
sh ./checkin-client.sh add _system/governance/oidlist.txt
sh ./checkin-client.sh ci -u admin -p admin



On Mon, Jun 2, 2014 at 1:36 PM, Sajini De Silva  wrote:

> Hi,
>
> I want to start the esb server from a script file and execute some
> check-in client commands from the same script, but once wso2server.sh is
> executed in the script it never return to the next line where other script
> commands are placed. Therefore my other script commands are not executed.
>
> Any suggestions on why it is happening?
>
> Thank you,
> Sajini.
> --
> Sajini De SIlva
> Software Engineer; WSO2 Inc.; http://wso2.com ,
> Email: saj...@wso2.com
> Blog: http://sajinid.blogspot.com/
> Git hub profile: https://github.com/sajinidesilva
>
>


-- 
Sajini De SIlva
Software Engineer; WSO2 Inc.; http://wso2.com ,
Email: saj...@wso2.com
Blog: http://sajinid.blogspot.com/
Git hub profile: https://github.com/sajinidesilva
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev