Conal-Tuohy / ands-la-trobe

Automatically exported from code.google.com/p/ands-la-trobe
1 stars 1 forks source link

Start JMS listener pipelines automatically on server startup #55

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Currently the pipelines are started manually. It would be good to start them in 
named screens so that we can observe them running if necessary.

Original issue reported on code.google.com by Conal.Tuohy on 4 Nov 2011 at 5:14

GoogleCodeExporter commented 9 years ago

Original comment by Conal.Tuohy on 4 Nov 2011 at 5:14

GoogleCodeExporter commented 9 years ago
The simplest method for doing this (on RHEL) is to exec them via 
/etc/rc.d/rc.local

Original comment by tosello....@gmail.com on 4 Nov 2011 at 7:07

GoogleCodeExporter commented 9 years ago

Original comment by Conal.Tuohy on 21 Nov 2011 at 7:04

GoogleCodeExporter commented 9 years ago
The following screen commands will start a detatched screen and push commands 
to it to be executed.

{{{

screen -dmS <sessionname>
screen -x <sessionname> -X stuff $'<command>\n'

}}}

Thus, we need to add something like the following to init.d (or a script run 
from init.d)

{{{
screen -dmS ingest
screen -x ingest -X stuff $'/home/fedora-user/pipelines/start.sh 
/home/fedora-user/pipelines/update-handler-configs/ingest-handler.xml'
screen -dmS metadata
screen -x metadata -X stuff $'/home/fedora-user/pipelines/start.sh 
/home/fedora-user/pipelines/update-handler-configs/metadata-update-handler.xml'
screen -dmS vamas
screen -x vamas -X stuff $'/home/fedora-user/pipelines/start.sh 
/home/fedora-user/pipelines/update-handler-configs/vamas-update-handler.xml'
}}}

Original comment by tosello....@gmail.com on 25 Nov 2011 at 3:43

GoogleCodeExporter commented 9 years ago
Made the following script and added it to /etc/rc.d/rc.local: 

{{{
#!/bin/sh

screen -dmS ingest
screen -dmS metadata
screen -dmS vamas

sleep 2s;

screen -S ingest -p 0 -X stuff $'/home/fedora-user/pipelines/start.sh 
/home/fedora-user/pipelines/update-handler-configs/ingest-handler.xml\n'

screen -S metadata -p 0 -X stuff $'/home/fedora-user/pipelines/start.sh 
/home/fedora-user/pipelines/update-handler-configs/metadata-update-handler.xml\n
'

screen -S vamas -p 0 -X stuff $'/home/fedora-user/pipelines/start.sh 
/home/fedora-user/pipelines/update-handler-configs/vamas-update-handler.xml\n'
}}}

Original comment by tosello....@gmail.com on 25 Nov 2011 at 4:54