mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-19 05:21:23 +02:00
commit
e49efe2065
@ -1 +0,0 @@
|
|||||||
etcd-0.0.1.ebuild
|
|
@ -9,7 +9,7 @@ EAPI=4
|
|||||||
CROS_WORKON_PROJECT="coreos/etcd"
|
CROS_WORKON_PROJECT="coreos/etcd"
|
||||||
CROS_WORKON_LOCALNAME="etcd"
|
CROS_WORKON_LOCALNAME="etcd"
|
||||||
CROS_WORKON_REPO="git://github.com"
|
CROS_WORKON_REPO="git://github.com"
|
||||||
CROS_WORKON_COMMIT="fac8d662445b2c09e3f24c282c2b37754bc7357f"
|
CROS_WORKON_COMMIT="7b289043c7beced434be4334fb909ba0b16b57b1" # hash for tag v0.1.1
|
||||||
inherit toolchain-funcs cros-workon systemd
|
inherit toolchain-funcs cros-workon systemd
|
||||||
|
|
||||||
DESCRIPTION="etcd"
|
DESCRIPTION="etcd"
|
||||||
@ -23,8 +23,6 @@ IUSE=""
|
|||||||
|
|
||||||
DEPEND=">=dev-lang/go-1.1"
|
DEPEND=">=dev-lang/go-1.1"
|
||||||
|
|
||||||
ETCD_PACKAGE="github.com/coreos/etcd"
|
|
||||||
|
|
||||||
src_compile() {
|
src_compile() {
|
||||||
./build
|
./build
|
||||||
}
|
}
|
@ -22,8 +22,6 @@ IUSE=""
|
|||||||
|
|
||||||
DEPEND=">=dev-lang/go-1.1"
|
DEPEND=">=dev-lang/go-1.1"
|
||||||
|
|
||||||
ETCD_PACKAGE="github.com/coreos/etcd"
|
|
||||||
|
|
||||||
src_compile() {
|
src_compile() {
|
||||||
./build
|
./build
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,11 @@
|
|||||||
|
|
||||||
VIRT=$(coreos-detect-virt)
|
VIRT=$(coreos-detect-virt)
|
||||||
STATE=/var/lib/etcd
|
STATE=/var/lib/etcd
|
||||||
|
DEFAULT_ARGS="-v -d $STATE -f"
|
||||||
|
|
||||||
if [ "${VIRT}" != "ec2" ]; then
|
if [ "${VIRT}" != "ec2" ]; then
|
||||||
echo "Detected environment \"${VIRT}\", just starting solo master..."
|
echo "Detected environment \"${VIRT}\", just starting solo master..."
|
||||||
exec /usr/bin/etcd -v -d $STATE
|
exec /usr/bin/etcd ${DEFAULT_ARGS}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
META_URL="http://169.254.169.254/latest"
|
META_URL="http://169.254.169.254/latest"
|
||||||
@ -20,9 +21,9 @@ IPS=$(grep -v $MY_IP $BOOTSTRAP|grep -v '^\n$' |sed 's/$/:7001/'|tr '\n' ','|sed
|
|||||||
|
|
||||||
if [ -z "$IPS" ]; then
|
if [ -z "$IPS" ]; then
|
||||||
echo "becoming master..."
|
echo "becoming master..."
|
||||||
exec /usr/bin/etcd -v -h $MY_IP -d $STATE
|
exec /usr/bin/etcd ${DEFAULT_ARGS} -h $MY_IP
|
||||||
else
|
else
|
||||||
echo "trying $IPS"
|
echo "trying $IPS"
|
||||||
set -x
|
set -x
|
||||||
exec /usr/bin/etcd -v -h $MY_IP -C "$IPS" -d $STATE
|
exec /usr/bin/etcd ${DEFAULT_ARGS} -h $MY_IP -C "$IPS"
|
||||||
fi
|
fi
|
||||||
|
@ -9,5 +9,10 @@ PermissionsStartOnly=true
|
|||||||
ExecStartPre=/usr/bin/etcd-pre-exec
|
ExecStartPre=/usr/bin/etcd-pre-exec
|
||||||
ExecStart=/usr/bin/etcd-bootstrap
|
ExecStart=/usr/bin/etcd-bootstrap
|
||||||
|
|
||||||
|
Restart=always
|
||||||
|
# Set a longish timeout in case this machine isn't behaving
|
||||||
|
# nicely and bothering the rest of the cluster
|
||||||
|
RestartSec=10s
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
Loading…
x
Reference in New Issue
Block a user