Jump to content

Running as a daemon so i can start stop etc

Recommended Posts

You can run it as a daemon.  In the Low Cost Alarm Project (see http://www.catalinacomputing.com/docs/Projects/LowCostAlarmProject/LowCostAlarmProject) in the "Wrap Up" section at the end, there's an example.


First, you will probably want a Scripts/user/startup.script file which creates your system.  Each time you start VW, whatever is in the startup.script file gets run.


Next you need to run VW as a daemon.  In the top level of your VW directory, there's a file called rc_local.script.  If you run this from the command line, it will start VW in the background as a daemon.  You can also call this file from /etc/rc.local, which will start up VW each time your host boots.


If you want to stop VW, find the processes associated with VW by typing from the command line:


ps x | grep ruby


You should see something like:


 3588 ?        Sl     0:01 ruby ./run_vw_application.rb -p 4567

 3596 ?        Sl     0:00 ruby ./run_padrino.rb 4567 ../virtualizer/virtualizer_standalone.config -e production -s start_script=[scripts/user/startup.script]

 3598 ?        Sl     0:20 /home/pi/.rvm/gems/ruby-2.0.0-p353@vw/bin/padrino                                                                                                            

 3609 ?        Sl     0:05 ruby ./run_with_retry.rb ./virtualizer.rb virtualizer_standalone.config -s start_script=[scripts/user/startup.script]

 3612 ?        Sl     0:19 ruby ./virtualizer.rb virtualizer_standalone.config -s start_script=[scripts/user/startup.script]

 3685 pts/0    S+     0:00 grep --color=auto ruby

The first 5 processes are VW (the last is our grep command).
Starting at the top process (here it's 3588), kill the 5 processes (kill 3588; kill 3596 .....).  Your VW daemon is stopped.


This is a question others will probably ask  - it should be listed in the FAQs.  I'll look into adding it.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...