#!/bin/sh# Add to /etc/inittab something like # m1:2345:respawn:/data/moloch/bin/run_capture.sh
TDIR=/data/moloch
cd ${TDIR}/bin/bin/rm -f ${TDIR}/capture.log.old/bin/mv ${TDIR}/logs/capture.log ${TDIR}/logs/capture.log.old
# wait for elasticsearch to show upsleep 15
${TDIR}/bin/moloch-capture -c ${TDIR}/etc/config.ini > ${TDIR}/logs/capture.log 2>&1
#!/bin/sh# Add to /etc/inittab something like # v1:2345:respawn:/data/moloch/bin/run_viewer.sh
TDIR=/data/moloch
cd ${TDIR}/viewer/bin/rm -f ${TDIR}/logs/viewer.log.old/bin/mv ${TDIR}/logs/viewer.log ${TDIR}/logs/viewer.log.old
export NODE_ENV=production
# wait for elasticsearch to show upsleep 15
${TDIR}/bin/node viewer.js -c ${TDIR}/etc/config.ini > ${TDIR}/logs/viewer.log 2>&1
escription "Upstart configuration for ElasticSearch" # When to start the servicestart on started network # When to stop the servicestop on runlevel [016] # Automatically restart the process if crashedrespawnrespawn limit 10 5 # Configurationenv ELASTICSEARCH_HOME=/data/moloch/elasticsearch-0.90.1env MOLOCH_HOME=/data/molochenv ES_HOSTNAME=molochenv ES_HEAP_SIZE=20000M console output
# bump up the number of files limit to a ridiculous numberlimit nofile 65535 65535 script exec /data/moloch/elasticsearch-0.90.1/bin/elasticsearch -f -Des.config=/data/moloch/etc/elasticsearch.ymlend script pre-stop script exec curl -XPOST http://localhost:9200/_shutdownend script
description "Upstart configuration for Capture" # When to start the servicestart on (started network and started moloch-elasticsearch)
# When to stop the servicestop on stopping moloch-elasticsearch # Automatically restart the process if crashedrespawnrespawn limit 10 5
script exec /data/moloch/bin/run_capture.shend script
description "Upstart configuration for Viewer"
# When to start the servicestart on started moloch-elasticsearch and started network
# When to stop the servicestop on stopping moloch-elasticsearch
# Automatically restart the process if crashedrespawnrespawn limit 10 5
script exec /data/moloch/bin/run_viewer.shend script
Hmm I specifically tested making sure the scripts work when I rebooted my VM that i have Moloch running on... Strange
--
Eric
--
You received this message because you are subscribed to the Google Groups "Moloch Full Packet Capture" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moloch-fpc+...@googlegroups.com.
To post to this group, send email to moloc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
On Sep 18, 2013 11:11 PM, "JA e" <jae.wi...@gmail.com> wrote:
>
> I had a non-upstart command in the files that was causing the hang at boot, my mistake.
>
> Now i get moloch-elasticsearch.conf to start, but it's not tracking the proper PID. Still learning about the joys of upstart... :)
JA I can throw up a fresh VM today and run easybutton, apply my upstart scripts and make sure they work ok. Maybe there's something I did on my original test VM that I forgot to document
We ended up ditching upstart for a cron'd script that checks every minute that things are running and restarts everything properly should ES die. We couldn't get upstart to properly follow forks. Seeing as upstart won't be in RHEL7 and we don't much care for systemd, this seems like the right way for us.