Commit f4a00dd0 authored by James Coyle's avatar James Coyle

Added hosts switch based on /etc/cockroachdb/hosts file existing or not

parent 2ae032a3
[Unit]
Description=Cockroach db auto starter
Description=Cockroach db
[Install]
WantedBy=multi-user.target
[Service]
ExecStart=/usr/local/bin/cockroach start --certs-dir=/etc/cockroachdb/certs --store=/var/data/cockroachdb/ --port=26257 --http-port=7005 --logtostderr=ERROR
ExecStartPre=/bin/bash -c "[[ -f /etc/cockroachdb/hosts ]] && (/bin/systemctl set-environment JOIN_SWITCH="--join="$(cat /etc/cockroachdb/hosts))"
ExecStart=/usr/local/bin/cockroach start --certs-dir=/etc/cockroachdb/certs \
--store=/var/data/cockroachdb/ \
--cache=.40 \
--max-sql-memory=.30 \
--external-io-dir=/tmp/cockroachdb/externalio \
--temp-dir=/tmp/cockroachdb/tmp \
--port=26257 \
--http-port=7005 \
--logtostderr=ERROR \
--log-dir=/var/logs/cockroachdb \
$JOIN_SWITCH
ExecStop=/usr/local/bin/cockroach quit --certs-dir=/etc/cockroachdb/certs
SyslogIdentifier=cockroachdb
Restart=always
RestartSec=10
StandardOutput=syslog
StandardError=syslog
LimitNOFILE=35000
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment