Re: Need help running scripts on EC2
I've had a look and I think we can get rid of the shopt command with little changes. I've filed an issue to keep track of this: https://issues.apache.org/jira/browse/JCLOUDS-283 On 13 September 2013 23:09, Ignasi wrote: > Nishant, could you share the ami id of that image and the details of the > failure? > > I extensively test jclouds-chef with Ubuntu AMIs (with the wrapper script) > and it works. > > El 13/09/2013 23:01, "Nishant Chandra" escribió: > >> It fails on Ubuntu. I tried that before moving to Amazon AMI. >> >> >> On Sat, Sep 14, 2013 at 2:14 AM, Ignasi wrote: >>> >>> Glad to hear it works! >>> >>> Yes. You'll see a symlink in your home pointing to the script that is >>> actually executed. You can read it to have a better understanding of how it >>> works. >>> >>> Zack: do you know an AMI that doesn't support that? I'll have a look and >>> try to build a working wrapper. >>> >>> El 13/09/2013 22:21, "Nishant Chandra" >>> escribió: I am using Amazon linux 64 bit AMI. Thanks Ignasi. I could debug and realized that if I wrap it in init script and gave full path to the script i.e. .addStatement(exec("/home/ec2-user/run.sh")), then it worked. So is it that temporary scripts are created in /tmp and user scripts are executed from there? On Sat, Sep 14, 2013 at 12:57 AM, Zack Shoylev wrote: > > I have seen some images that do not support bash-shopt which is what > jclouds uses to wrap scripts (in the header). > What image is being used? > > > From: Ignasi [ignasi.barr...@gmail.com] > Sent: Friday, September 13, 2013 2:19 PM > To: user@jclouds.incubator.apache.org > Subject: Need help running scripts on EC2 > > A couple considerations: > > * You don't have to manually render the script. You can directle pass > the 'exec("foo")' to the submitScriptOnNode method and jclouds will take > care of rendering it properly depending on the type of the Template being > deployed. > * Why don't you want to wrap it in the init script? If you wrap it > (which is done by default), you will see a directory created in /tmp > containing files with the stdout and the stderr for the script. You can > tail > them to see the progress, or paste them here to diagnose what can be going > on. > * By default jclouds waits until the script completes, so if the server > is started in the foreground by your script, it may not terminate, and the > returned future will wait forever. If this is the case, perhaps a better > approach would be to wrap your script in a nohup. > > > HTH > > Ignasi > > > On Friday, 13 September 2013, Andrew Phillips wrote: >>> >>> The script does not start. The script starts a server and exits, >>> something >>> like java -jar somejar.jar >> >> >> Have you tried putting any "echo starting > /my/log/file" statements >> in the script, just to see if it even ever gets invoked? >> >> Regards >> >> ap -- Nishant Chandra Bangalore, India Cell : +91 9739131616 >> >> >> >> >> -- >> Nishant Chandra >> Bangalore, India >> Cell : +91 9739131616
Re: Need help running scripts on EC2
Nishant, could you share the ami id of that image and the details of the failure? I extensively test jclouds-chef with Ubuntu AMIs (with the wrapper script) and it works. El 13/09/2013 23:01, "Nishant Chandra" escribió: > It fails on Ubuntu. I tried that before moving to Amazon AMI. > > > On Sat, Sep 14, 2013 at 2:14 AM, Ignasi wrote: > >> Glad to hear it works! >> >> Yes. You'll see a symlink in your home pointing to the script that is >> actually executed. You can read it to have a better understanding of how it >> works. >> >> Zack: do you know an AMI that doesn't support that? I'll have a look and >> try to build a working wrapper. >> El 13/09/2013 22:21, "Nishant Chandra" >> escribió: >> >>> I am using Amazon linux 64 bit AMI. >>> >>> Thanks Ignasi. I could debug and realized that if I wrap it in init >>> script and gave full path to the script i.e. >>> .addStatement(exec("/home/ec2-user/run.sh")), then it worked. >>> >>> So is it that temporary scripts are created in /tmp and user scripts are >>> executed from there? >>> >>> >>> >>> On Sat, Sep 14, 2013 at 12:57 AM, Zack Shoylev < >>> zack.shoy...@rackspace.com> wrote: >>> I have seen some images that do not support bash-shopt which is what jclouds uses to wrap scripts (in the header). What image is being used? -- *From:* Ignasi [ignasi.barr...@gmail.com] *Sent:* Friday, September 13, 2013 2:19 PM *To:* user@jclouds.incubator.apache.org *Subject:* Need help running scripts on EC2 A couple considerations: * You don't have to manually render the script. You can directle pass the 'exec("foo")' to the submitScriptOnNode method and jclouds will take care of rendering it properly depending on the type of the Template being deployed. * Why don't you want to wrap it in the init script? If you wrap it (which is done by default), you will see a directory created in /tmp containing files with the stdout and the stderr for the script. You can tail them to see the progress, or paste them here to diagnose what can be going on. * By default jclouds waits until the script completes, so if the server is started in the foreground by your script, it may not terminate, and the returned future will wait forever. If this is the case, perhaps a better approach would be to wrap your script in a nohup. HTH Ignasi On Friday, 13 September 2013, Andrew Phillips wrote: > The script does not start. The script starts a server and exits, >> something >> like java -jar somejar.jar >> > > Have you tried putting any "echo starting > /my/log/file" statements > in the script, just to see if it even ever gets invoked? > > Regards > > ap > >>> >>> >>> -- >>> Nishant Chandra >>> Bangalore, India >>> Cell : +91 9739131616 >>> >> > > > -- > Nishant Chandra > Bangalore, India > Cell : +91 9739131616 >
Re: Need help running scripts on EC2
It fails on Ubuntu. I tried that before moving to Amazon AMI. On Sat, Sep 14, 2013 at 2:14 AM, Ignasi wrote: > Glad to hear it works! > > Yes. You'll see a symlink in your home pointing to the script that is > actually executed. You can read it to have a better understanding of how it > works. > > Zack: do you know an AMI that doesn't support that? I'll have a look and > try to build a working wrapper. > El 13/09/2013 22:21, "Nishant Chandra" > escribió: > >> I am using Amazon linux 64 bit AMI. >> >> Thanks Ignasi. I could debug and realized that if I wrap it in init >> script and gave full path to the script i.e. >> .addStatement(exec("/home/ec2-user/run.sh")), then it worked. >> >> So is it that temporary scripts are created in /tmp and user scripts are >> executed from there? >> >> >> >> On Sat, Sep 14, 2013 at 12:57 AM, Zack Shoylev < >> zack.shoy...@rackspace.com> wrote: >> >>> I have seen some images that do not support bash-shopt which is what >>> jclouds uses to wrap scripts (in the header). >>> What image is being used? >>> >>> -- >>> *From:* Ignasi [ignasi.barr...@gmail.com] >>> *Sent:* Friday, September 13, 2013 2:19 PM >>> *To:* user@jclouds.incubator.apache.org >>> *Subject:* Need help running scripts on EC2 >>> >>> A couple considerations: >>> >>> * You don't have to manually render the script. You can directle pass >>> the 'exec("foo")' to the submitScriptOnNode method and jclouds will take >>> care of rendering it properly depending on the type of the Template being >>> deployed. >>> * Why don't you want to wrap it in the init script? If you wrap it >>> (which is done by default), you will see a directory created in /tmp >>> containing files with the stdout and the stderr for the script. You can >>> tail them to see the progress, or paste them here to diagnose what can be >>> going on. >>> * By default jclouds waits until the script completes, so if the server >>> is started in the foreground by your script, it may not terminate, and the >>> returned future will wait forever. If this is the case, perhaps a better >>> approach would be to wrap your script in a nohup. >>> >>> >>> HTH >>> >>> Ignasi >>> >>> >>> On Friday, 13 September 2013, Andrew Phillips wrote: >>> The script does not start. The script starts a server and exits, > something > like java -jar somejar.jar > Have you tried putting any "echo starting > /my/log/file" statements in the script, just to see if it even ever gets invoked? Regards ap >>> >> >> >> -- >> Nishant Chandra >> Bangalore, India >> Cell : +91 9739131616 >> > -- Nishant Chandra Bangalore, India Cell : +91 9739131616
RE: Need help running scripts on EC2
Ignasi: I have seen that on "cirros-0.3.1-x86_64-uec" - this is one of the default devstack images. From: Ignasi [ignasi.barr...@gmail.com] Sent: Friday, September 13, 2013 3:44 PM To: user@jclouds.incubator.apache.org Subject: Re: Need help running scripts on EC2 Glad to hear it works! Yes. You'll see a symlink in your home pointing to the script that is actually executed. You can read it to have a better understanding of how it works. Zack: do you know an AMI that doesn't support that? I'll have a look and try to build a working wrapper. El 13/09/2013 22:21, "Nishant Chandra" mailto:nishant.chan...@gmail.com>> escribió: I am using Amazon linux 64 bit AMI. Thanks Ignasi. I could debug and realized that if I wrap it in init script and gave full path to the script i.e. .addStatement(exec("/home/ec2-user/run.sh")), then it worked. So is it that temporary scripts are created in /tmp and user scripts are executed from there? On Sat, Sep 14, 2013 at 12:57 AM, Zack Shoylev mailto:zack.shoy...@rackspace.com>> wrote: I have seen some images that do not support bash-shopt which is what jclouds uses to wrap scripts (in the header). What image is being used? From: Ignasi [ignasi.barr...@gmail.com<mailto:ignasi.barr...@gmail.com>] Sent: Friday, September 13, 2013 2:19 PM To: user@jclouds.incubator.apache.org<mailto:user@jclouds.incubator.apache.org> Subject: Need help running scripts on EC2 A couple considerations: * You don't have to manually render the script. You can directle pass the 'exec("foo")' to the submitScriptOnNode method and jclouds will take care of rendering it properly depending on the type of the Template being deployed. * Why don't you want to wrap it in the init script? If you wrap it (which is done by default), you will see a directory created in /tmp containing files with the stdout and the stderr for the script. You can tail them to see the progress, or paste them here to diagnose what can be going on. * By default jclouds waits until the script completes, so if the server is started in the foreground by your script, it may not terminate, and the returned future will wait forever. If this is the case, perhaps a better approach would be to wrap your script in a nohup. HTH Ignasi On Friday, 13 September 2013, Andrew Phillips wrote: The script does not start. The script starts a server and exits, something like java -jar somejar.jar Have you tried putting any "echo starting > /my/log/file" statements in the script, just to see if it even ever gets invoked? Regards ap -- Nishant Chandra Bangalore, India Cell : +91 9739131616
Re: Need help running scripts on EC2
I am using Amazon linux 64 bit AMI. Thanks Ignasi. I could debug and realized that if I wrap it in init script and gave full path to the script i.e. .addStatement(exec("/home/ec2-user/run.sh")), then it worked. So is it that temporary scripts are created in /tmp and user scripts are executed from there? On Sat, Sep 14, 2013 at 12:57 AM, Zack Shoylev wrote: > I have seen some images that do not support bash-shopt which is what > jclouds uses to wrap scripts (in the header). > What image is being used? > > -- > *From:* Ignasi [ignasi.barr...@gmail.com] > *Sent:* Friday, September 13, 2013 2:19 PM > *To:* user@jclouds.incubator.apache.org > *Subject:* Need help running scripts on EC2 > > A couple considerations: > > * You don't have to manually render the script. You can directle pass > the 'exec("foo")' to the submitScriptOnNode method and jclouds will take > care of rendering it properly depending on the type of the Template being > deployed. > * Why don't you want to wrap it in the init script? If you wrap it (which > is done by default), you will see a directory created in /tmp containing > files with the stdout and the stderr for the script. You can tail them to > see the progress, or paste them here to diagnose what can be going on. > * By default jclouds waits until the script completes, so if the server is > started in the foreground by your script, it may not terminate, and the > returned future will wait forever. If this is the case, perhaps a better > approach would be to wrap your script in a nohup. > > > HTH > > Ignasi > > > On Friday, 13 September 2013, Andrew Phillips wrote: > >> The script does not start. The script starts a server and exits, >>> something >>> like java -jar somejar.jar >>> >> >> Have you tried putting any "echo starting > /my/log/file" statements in >> the script, just to see if it even ever gets invoked? >> >> Regards >> >> ap >> > -- Nishant Chandra Bangalore, India Cell : +91 9739131616
Re: Need help running scripts on EC2
Glad to hear it works! Yes. You'll see a symlink in your home pointing to the script that is actually executed. You can read it to have a better understanding of how it works. Zack: do you know an AMI that doesn't support that? I'll have a look and try to build a working wrapper. El 13/09/2013 22:21, "Nishant Chandra" escribió: > I am using Amazon linux 64 bit AMI. > > Thanks Ignasi. I could debug and realized that if I wrap it in init script > and gave full path to the script i.e. > .addStatement(exec("/home/ec2-user/run.sh")), then it worked. > > So is it that temporary scripts are created in /tmp and user scripts are > executed from there? > > > > On Sat, Sep 14, 2013 at 12:57 AM, Zack Shoylev > wrote: > >> I have seen some images that do not support bash-shopt which is what >> jclouds uses to wrap scripts (in the header). >> What image is being used? >> >> -- >> *From:* Ignasi [ignasi.barr...@gmail.com] >> *Sent:* Friday, September 13, 2013 2:19 PM >> *To:* user@jclouds.incubator.apache.org >> *Subject:* Need help running scripts on EC2 >> >> A couple considerations: >> >> * You don't have to manually render the script. You can directle pass >> the 'exec("foo")' to the submitScriptOnNode method and jclouds will take >> care of rendering it properly depending on the type of the Template being >> deployed. >> * Why don't you want to wrap it in the init script? If you wrap it (which >> is done by default), you will see a directory created in /tmp containing >> files with the stdout and the stderr for the script. You can tail them to >> see the progress, or paste them here to diagnose what can be going on. >> * By default jclouds waits until the script completes, so if the server >> is started in the foreground by your script, it may not terminate, and the >> returned future will wait forever. If this is the case, perhaps a better >> approach would be to wrap your script in a nohup. >> >> >> HTH >> >> Ignasi >> >> >> On Friday, 13 September 2013, Andrew Phillips wrote: >> >>> The script does not start. The script starts a server and exits, something like java -jar somejar.jar >>> >>> Have you tried putting any "echo starting > /my/log/file" statements in >>> the script, just to see if it even ever gets invoked? >>> >>> Regards >>> >>> ap >>> >> > > > -- > Nishant Chandra > Bangalore, India > Cell : +91 9739131616 >
Re: Need help running scripts on EC2
The script does not start. The script starts a server and exits, something like java -jar somejar.jar Have you tried putting any "echo starting > /my/log/file" statements in the script, just to see if it even ever gets invoked? Regards ap
RE: Need help running scripts on EC2
I have seen some images that do not support bash-shopt which is what jclouds uses to wrap scripts (in the header). What image is being used? From: Ignasi [ignasi.barr...@gmail.com] Sent: Friday, September 13, 2013 2:19 PM To: user@jclouds.incubator.apache.org Subject: Need help running scripts on EC2 A couple considerations: * You don't have to manually render the script. You can directle pass the 'exec("foo")' to the submitScriptOnNode method and jclouds will take care of rendering it properly depending on the type of the Template being deployed. * Why don't you want to wrap it in the init script? If you wrap it (which is done by default), you will see a directory created in /tmp containing files with the stdout and the stderr for the script. You can tail them to see the progress, or paste them here to diagnose what can be going on. * By default jclouds waits until the script completes, so if the server is started in the foreground by your script, it may not terminate, and the returned future will wait forever. If this is the case, perhaps a better approach would be to wrap your script in a nohup. HTH Ignasi On Friday, 13 September 2013, Andrew Phillips wrote: The script does not start. The script starts a server and exits, something like java -jar somejar.jar Have you tried putting any "echo starting > /my/log/file" statements in the script, just to see if it even ever gets invoked? Regards ap