A única coisa que sei que funcionaria é criar (ou procurar e instalar) scripts de inicialização para elasticsearch e couchdb para que você possa usar a opção "start on".
Upstart script for couchdb
# couchdb v1.2.0 # # Custom installation of CouchDB description "CouchDB v1.2.0, local" console output # start after all filesystems & network interfae are available start on (local-filesystems and net-device-up IFACE!=lo) stop on runlevel [!2345] # set working directory env COUCHDB_WD="/path/to/build-couchdb/build/bin" export COUCHDB_WD # required for erlang env HOME="/home/user" export HOME script # modify PATH to hit local couchdb's working directory first PATH="$COUCHDB_WD:$PATH" #export PATH # not necessary inside script block #logger -t $0 "HOME='$HOME'" #logger -t $0 "PATH='$PATH'" # output couchdb logs to custom location #exec >>/home/user/couchdb_local.log 2>&1 exec couchdb end script
- edite o env para o que você precisa;
- Fonte: link
Upstart for elasticsearch
# ElasticSearch Service description "ElasticSearch" start on (net-device-up and local-filesystems and runlevel [2345]) stop on runlevel [016] respawn limit 10 5 env ES_HOME=/usr/share/elasticsearch/home env ES_MIN_MEM=256m env ES_MAX_MEM=2g env DAEMON="${ES_HOME}/bin/elasticsearch" env DATA_DIR=/data/elasticsearch/data env CONFIG_DIR=/etc/elasticsearch console output script if [ -f /etc/default/elasticsearch ]; then . /etc/default/elasticsearch fi su -s /bin/dash -c "/usr/bin/elasticsearch -f -Des.path.conf=$CONFIG_DIR -Des.path.home=$ES_HOME -Des.path.logs=$LOG_DIR -Des.path.data=$DATA_DIR -Des.path.work=$WORK_DIR" elasticsearch end script
- Fonte: link
- Altere o dir de env para o que você precisa.