[Capistrano] Re: Starting a custom service with #run
It's an init-style script (start|stop|restart) but with a caveat that one needs to be in the project directory to start the service. Thus, the command line I'm running is: cd /opt/project sh /opt/project/etc/start_project.sh start When I run this in the capistrano shell, or while logged into the machine, the service starts right up and is happy. When I let Cap run through the script, it hits this line and seems to succeed, but no service is ever started. Jason On Jan 12, 5:36 pm, Lee Hambley lee.hamb...@gmail.com wrote: Jason, How are you trying to start the services? - Lee 2009/1/12 Jason Roelofs jameskil...@gmail.com So I'm stuck. I'm using Capistrano to make a push-button script for starting up a new EC2 instance along with software installs and starting up necessary services. The first two steps work great, but I cannot for the life of me get Cap to start up any services I want running. I am using nohup to get the service started as per suggestions I found. I can run the command directly on the server, I can run the command in the capistrano shell even, but when I let the cap script run through, it just won't work. I do have :pty = true set. I can't find anything else to get this working. I'm not sure what details I can give, but I can put together a more detailed script example if needed. Thanks for your help. Jason --~--~-~--~~~---~--~~ To unsubscribe from this group, send email to capistrano-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/capistrano -~--~~~~--~~--~--~---
[Capistrano] Re: Starting a custom service with #run
Jason, Might I suggest you alter your script to be - sh /opt/project/etc/start_project.sh start and for start_project.sh to do a CD as its first call? You should be able to do what you need, I have an example just like yours in my application, but it doesn't start services... You may find that your script finishes once the terminal disconnects, in which case you may need to screen (or similar) it - so it keeps running even after losing its parent shell. Can you run your command like this? - ssh m...@the-server.com -c 'cd /opt/project sh /opt/project/etc/start_project.sh start' which is effectively what Capistrano is doing via Net::SSH. - Lee 2009/1/13 Jason Roelofs jameskil...@gmail.com It's an init-style script (start|stop|restart) but with a caveat that one needs to be in the project directory to start the service. Thus, the command line I'm running is: cd /opt/project sh /opt/project/etc/start_project.sh start When I run this in the capistrano shell, or while logged into the machine, the service starts right up and is happy. When I let Cap run through the script, it hits this line and seems to succeed, but no service is ever started. Jason On Jan 12, 5:36 pm, Lee Hambley lee.hamb...@gmail.com wrote: Jason, How are you trying to start the services? - Lee 2009/1/12 Jason Roelofs jameskil...@gmail.com So I'm stuck. I'm using Capistrano to make a push-button script for starting up a new EC2 instance along with software installs and starting up necessary services. The first two steps work great, but I cannot for the life of me get Cap to start up any services I want running. I am using nohup to get the service started as per suggestions I found. I can run the command directly on the server, I can run the command in the capistrano shell even, but when I let the cap script run through, it just won't work. I do have :pty = true set. I can't find anything else to get this working. I'm not sure what details I can give, but I can put together a more detailed script example if needed. Thanks for your help. Jason --~--~-~--~~~---~--~~ To unsubscribe from this group, send email to capistrano-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/capistrano -~--~~~~--~~--~--~---
[Capistrano] Re: Starting a custom service with #run
Can you run your command like this? - ssh m...@the-server.com -c 'cd /opt/project sh /opt/project/etc/start_project.sh start' which is effectively what Capistrano is doing via Net::SSH. Actually, I can. Running the script that way works perfectly fine, which is why I'm completely stumped. I've even tried making a separate script that itself does the cd ... script.sh start, then told capistrano to do: run sh the_starter_script.sh but it still doesn't work. For now I think I'm just going to jump back to the command line and run ssh myself. This doesn't make sense and I have to imagine I've messed something up somewhere, but just can't find it. Thanks Jason --~--~-~--~~~---~--~~ To unsubscribe from this group, send email to capistrano-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/capistrano -~--~~~~--~~--~--~---
[Capistrano] Re: Starting a custom service with #run
On Jan 13, 2009, at 8:09 AM, Jason Roelofs wrote: Can you run your command like this? - ssh m...@the-server.com -c 'cd /opt/project sh /opt/project/etc/start_project.sh start' which is effectively what Capistrano is doing via Net::SSH. Actually, I can. Running the script that way works perfectly fine, which is why I'm completely stumped. as the same *user* ?? i'd imagine your ssh command, and cap's, run as two different users with two different environments. a @ http://codeforpeople.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama --~--~-~--~~~---~--~~ To unsubscribe from this group, send email to capistrano-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/capistrano -~--~~~~--~~--~--~---
[Capistrano] Re: Starting a custom service with #run
On Jan 13, 10:20 am, ara.t.howard ara.t.how...@gmail.com wrote: On Jan 13, 2009, at 8:09 AM, Jason Roelofs wrote: Can you run your command like this? - ssh m...@the-server.com -c 'cd /opt/project sh /opt/project/etc/start_project.sh start' which is effectively what Capistrano is doing via Net::SSH. Actually, I can. Running the script that way works perfectly fine, which is why I'm completely stumped. as the same *user* ?? i'd imagine your ssh command, and cap's, run as two different users with two different environments. a @http://codeforpeople.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama No. This is run on brand new EC2 instances, there's only one user, root, and I'm forcing Capistrano to use the appropriate ssh keys sitting in my .ssh (which is the only way to connect to said instances for those that haven't messed with EC2 yet). Jason --~--~-~--~~~---~--~~ To unsubscribe from this group, send email to capistrano-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/capistrano -~--~~~~--~~--~--~---
[Capistrano] Re: Starting a custom service with #run
On Jan 13, 2009, at 9:08 AM, Jason Roelofs wrote: No. This is run on brand new EC2 instances, there's only one user, root, and I'm forcing Capistrano to use the appropriate ssh keys sitting in my .ssh (which is the only way to connect to said instances for those that haven't messed with EC2 yet). it should be really simple to show the output of running the command from the shell and invoke then - my guess is something is different with your environment. maybe an environment setting in your capfile? a @ http://codeforpeople.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama --~--~-~--~~~---~--~~ To unsubscribe from this group, send email to capistrano-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/capistrano -~--~~~~--~~--~--~---
[Capistrano] Re: Starting a custom service with #run
Jason, How are you trying to start the services? - Lee 2009/1/12 Jason Roelofs jameskil...@gmail.com So I'm stuck. I'm using Capistrano to make a push-button script for starting up a new EC2 instance along with software installs and starting up necessary services. The first two steps work great, but I cannot for the life of me get Cap to start up any services I want running. I am using nohup to get the service started as per suggestions I found. I can run the command directly on the server, I can run the command in the capistrano shell even, but when I let the cap script run through, it just won't work. I do have :pty = true set. I can't find anything else to get this working. I'm not sure what details I can give, but I can put together a more detailed script example if needed. Thanks for your help. Jason --~--~-~--~~~---~--~~ To unsubscribe from this group, send email to capistrano-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/capistrano -~--~~~~--~~--~--~---