You could also fork the existing process, then detach it. This would give you the exact environment your original process was running. Once you detach it, it runs in the background.
Matt On Sep 5, 3:36 pm, Duncan Robertson <[EMAIL PROTECTED]> wrote: > No problem Jamis, thanks again for a wonderful piece of software. Are > you going to be at RailConf Europe? > > And thanks Joe for the knowledge :) > > On 5 Sep, 18:11, Joe <[EMAIL PROTECTED]> wrote: > > > Duncan, > > > I did something like this recently. I have a recipe with a task that > > makes an init script, puts it in /etc/init.d and calls chkconfig --add > > on it (with the appropriate levels). Also, I have a task which starts > > it initially from cap, using "run 'nohup /etc/init.d/myservice start'" > > or something like that. The 'nohup' ensures that the process doesn't > > exit when the SSH session ends (though you won't always need that if > > the program you are starting properly daemonizes and detaches). > > > I can send you the code if you contact me offline, but it really isn't > > much more complicated than that. The only tricky part is getting a > > proper init script for whatever app you are running. > > > Joe > > > On Sep 5, 11:43 am, Duncan Robertson <[EMAIL PROTECTED]> wrote: > > > > Thanks Jamis, > > > > I knew this would require me building a recipe of my own. To be honest > > > I have no problem getting to the point where the app is deployable to > > > the server and all the folders and symlinks are correct as far as my > > > app goes. I've been a big fan (and user) of cap since switchtower :) > > > The point at which I'm stuck is the daemonizing of the stand alone > > > app. I guess this might not be the place to ask but I thought maybe > > > someone had used capinstrano to do something similar before. i.e > > > > - deploy stand alone app > > > - getting it running in it's own process or re-start the existing > > > - make sure it restarts if machine is re-booted > > > - make sure it continues if someone logs out > > > > Duncan > > > > On Sep 5, 2:18 pm, "Jamis Buck" <[EMAIL PROTECTED]> wrote: > > > > > The existing deployment system probably won't be what you need, since > > > > it assumes you're deploying a web-application. > > > > > In order to determine how to use Capistrano to automate a task, the > > > > simplest process is this: > > > > > 1. Write down the steps you would take if you were performing the task > > > > manually. > > > > > 2. Break the steps into tasks (maybe 1 step == 1 task, maybe not). > > > > > 3. Code it up in a recipe. > > > > > - Jamis > > > > > On 9/5/07, Duncan Robertson <[EMAIL PROTECTED]> wrote: > > > > > > Hi, > > > > > > I have a stand alone ruby script that I would like to deploy to a > > > > > server and run as a daemon on that machine. I know this must be > > > > > possible via capinstano (I have capinstrano experience, just not with > > > > > daemons) but could someone point me in the right direction? > > > > > > I've looked at the daemons gem which I guess must be helpful in this > > > > > task. > > > > > > Best, > > > > > Duncan --~--~---------~--~----~------------~-------~--~----~ To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/capistrano -~----------~----~----~----~------~----~------~--~---
