diff options
author | Francesco Colista <fcolista@alpinelinux.org> | 2016-05-09 08:20:56 +0000 |
---|---|---|
committer | Francesco Colista <fcolista@alpinelinux.org> | 2016-05-09 08:21:00 +0000 |
commit | d37d8fe99be7e138bfc24144d24200e8e1e9ed3f (patch) | |
tree | 17839237cfa68a1caa76df02f917d1741f734878 | |
parent | 1dc3d131f36dc307adb248f89377a0f585263eb2 (diff) | |
download | aports-d37d8fe99be7e138bfc24144d24200e8e1e9ed3f.zip |
testing/etcd: new aport
-rw-r--r-- | testing/etcd/APKBUILD | 46 | ||||
-rw-r--r-- | testing/etcd/etcd.confd | 256 | ||||
-rw-r--r-- | testing/etcd/etcd.initd | 37 | ||||
-rwxr-xr-x | testing/etcd/etcd.pre-install | 4 |
4 files changed, 343 insertions, 0 deletions
diff --git a/testing/etcd/APKBUILD b/testing/etcd/APKBUILD new file mode 100644 index 00000000000..ed0c04c3519 --- /dev/null +++ b/testing/etcd/APKBUILD @@ -0,0 +1,46 @@ +# Contributor: Francesco Colista <fcolista@alpinelinux.org> +# Maintainer: Francesco Colista <fcolista@alpinelinux.org> +pkgname=etcd +pkgver=2.3.3 +pkgrel=0 +pkgdesc="A highly-available key value store for shared configuration and service discovery" +url="https://github.com/coreos/etcd" +arch="x86_64" +license="APACHE2.0" +depends="" +depends_dev="" +makedepends="$depends_dev go" +install="$pkgname.pre-install" +subpackages="" +pkgusers="$pkgname" +pkggroups="$pkgname" +source="$pkgname-$pkgver.tar.gz::https://github.com/coreos/etcd/archive/v$pkgver.tar.gz + $pkgname.confd + $pkgname.initd" + +builddir="$srcdir"/$pkgname-$pkgver +build() { + cd "$builddir" + ./build +} + +package() { + cd "$builddir" + mkdir -p "$pkgdir"/var/lib/$pkgname + chown -R $pkgusers:$pkggroups "$pkgdir"/var/lib/$pkgname + install -Dm755 bin/etcdctl "$pkgdir"/usr/bin/etcdctl + install -Dm755 bin/etcd "$pkgdir"/usr/bin/etcd + install -Dm755 $srcdir/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname + install -Dm755 $srcdir/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname + install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE +} + +md5sums="ad7147956855391b65c125a462840fa0 etcd-2.3.3.tar.gz +ac04c0d36942fff31da8a9abe0ac4b68 etcd.confd +3ac0aecccd36288a5b72136da7c6d133 etcd.initd" +sha256sums="9a765d15e0c1516191430d6e730920251e503c484deab69f7e06b82d51fd010c etcd-2.3.3.tar.gz +2f3d37317ccaaddf4ec53e77be9419d63590d0114edcae383f47c0607dd643a9 etcd.confd +6334c8578a3eb7054ece4427446cc8bbc1b8ddb1794ff397ff9ae405c0d391f6 etcd.initd" +sha512sums="6794526602d981c4b1fb3d7a51f9f2e35060f2b79e1e42ba030d4e3ce2d789d7701c04310caf580a6b18817b3f924d99ff437bb902f9db7c4a944a35b27b40e1 etcd-2.3.3.tar.gz +440c9f23decb318c565a79d376b107dbd2333e72d5d812ec1460732543348737468b3e66e82e06a1afa0f09760c1eb066804a668a24e92a23977758727e049d2 etcd.confd +99271b1ae4a5636ae2332a98d35a5d9e27cac9154d5ede7952b0627caca53ef0b0d8164aa18f53c25e42e969b80e534930c2a3ed0bd0a1fdaec093075016355c etcd.initd" diff --git a/testing/etcd/etcd.confd b/testing/etcd/etcd.confd new file mode 100644 index 00000000000..c0c912261f6 --- /dev/null +++ b/testing/etcd/etcd.confd @@ -0,0 +1,256 @@ +SVCNAME=etcd +PIDPATH=/var/run/${SVCNAME} +PIDFILE=${PIDPATH}/${SVCNAME}.pid +LOGPATH=/var/log/${SVCNAME} +DATADIR=/var/lib/${SVCNAME} +USER=$SVCNAME + +# +# default: "default" +# +ETCD_NAME="default" + +# Path to the data directory. +# +# default: "${name}.etcd" +# distribution default: "/var/lib/etcd" +# +ETCD_DATA_DIR="/var/lib/etcd" + +# Path to the dedicated wal directory. +# If this flag is set, etcd will write the WAL files +# to the walDir rather than the dataDir. +# +# default: "" +# +# ETCD_WAL_DIR="" + +# Number of committed transactions to trigger a snapshot to disk. +# +# default: 10000 +# +# ETCD_SNAPSHOT_COUNT=10000 + +# Time (in milliseconds) of a heartbeat interval. +# +# default: 100 +# +# ETCD_HEARTBEAT_INTERVAL=100 + +# Time (in milliseconds) for an election to timeout. +# +# default: 1000 +# +# ETCD_ELECTION_TIMEOUT=1000 + +# List of URLs to listen on for peer traffic. +# +# default: "http://localhost:2380,http://localhost:7001" +# +# ETCD_LISTEN_PEER_URLS="http://localhost:2380,http://localhost:7001" + +# List of URLs to listen on for client traffic. +# +# default: "http://localhost:2379,http://localhost:4001" +# +# ETCD_LISTEN_CLIENT_URLS="http://localhost:2379,http://localhost:4001" + +# Maximum number of snapshot files to retain (0 is unlimited) +# +# default: 5 +# +# ETCD_MAX_SNAPSHOTS=5 + +# Maximum number of wal files to retain (0 is unlimited) +# +# default: 5 +# +# ETCD_MAX_WALS=5 + +# Comma_separated white list of origins for CORS (cross_origin resource sharing). +# +# default: none +# +# ETCD_CORS= + +# List of this member's peer URLs to advertise to the rest of the cluster. +# These addresses are used for communicating etcd data around the cluster. +# At least one must be routable to all cluster members. +# +# default: "http://localhost:2380,http://localhost:7001" +# +# ETCD_INITIAL_ADVERTISE_PEER_URLS="http://localhost:2380,http://localhost:7001" + +# Initial cluster configuration for bootstrapping. +# +# default: "default=http://localhost:2380,default=http://localhost:7001" +# distribution default: "default=http://localhost:2380,default=http://localhost:7001" +# +# ETCD_INITIAL_CLUSTER="default=http://localhost:2380,default=http://localhost:7001" + +# Initial cluster state ("new" or "existing"). +# Set to new for all members present during initial static or DNS bootstrapping. +# If this option is set to existing, etcd will attempt to join the existing cluster. +# If the wrong value is set, etcd will attempt to start but fail safely. +# +# default: "new" +# +# ETCD_INITIAL_CLUSTER_STATE="new" + +# Initial cluster token for the etcd cluster during bootstrap. +# +# default: "etcd_cluster" +# +# ETCD_INITIAL_CLUSTER_TOKEN="etcd_cluster" + +# List of this member's client URLs to advertise to the rest of the cluster. +# +# default: "http://localhost:2379,http://localhost:4001" +# +# ETCD_ADVERTISE_CLIENT_URLS="http://localhost:2379,http://localhost:4001" + +# Discovery URL used to bootstrap the cluster. +# +# default: none +# +# ETCD_DISCOVERY= + +# DNS srv domain used to bootstrap the cluster. +# +# default: none +# +# ETCD_DISCOVERY_SRV= + +# Expected behavior ("exit" or "proxy") when discovery services fails. +# +# default: "proxy" +# +# ETCD_DISCOVERY_FALLBACK="proxy" + +# HTTP proxy to use for traffic to discovery service. +# +# default: none +# +# ETCD_DISCOVERY_PROXY= + +# Proxy mode setting ("off", "readonly" or "on"). +# +# default: "off" +# +# ETCD_PROXY="off" + +# Time (in milliseconds) an endpoint will be held +# in a failed state before being reconsidered for proxied requests. +# +# default: 5000 +# +# ETCD_PROXY_FAILURE_WAIT=5000 + +# Time (in milliseconds) of the endpoints refresh interval. +# +# default: 30000 +# +# ETCD_PROXY_REFRESH_INTERVAL=30000 + +# Time (in milliseconds) for a dial to timeout or 0 to disable the timeout. +# +# default: 1000 +# +# ETCD_PROXY_DIAL_TIMEOUT=1000 + +# Time (in milliseconds) for a write to timeout or 0 to disable the timeout. +# +# default: 5000 +# +# ETCD_PROXY_WRITE_TIMEOUT=5000 + +# Time (in milliseconds) for a read to timeout or 0 to disable the timeout. +# Don't change this value if you use watches because they are using long polling requests. +# +# default: 0 +# +# ETCD_PROXY_READ_TIMEOUT=0 + +# Path to the client server TLS CA file. +# +# default: none +# +# ETCD_CA_FILE= + +# Path to the client server TLS cert file. +# +# default: none +# +# ETCD_CERT_FILE= + +# Path to the client server TLS key file. +# +# default: none +# +# ETCD_KEY_FILE= + +# Enable client cert authentication. +# +# default: false +# +# ETCD_CLIENT_CERT_AUTH=false + +# Path to the client server TLS trusted CA key file. +# +# default: none +# +# ETCD_TRUSTED_CA_FILE= + +# [DEPRECATED] Path to the peer server TLS CA file. +# +# default: none +# +# ETCD_PEER_CA_FILE= + +# Path to the peer server TLS cert file. +# +# default: none +# +# ETCD_PEER_CERT_FILE= + +# Path to the peer server TLS key file. +# +# default: none +# +# ETCD_PEER_KEY_FILE= + +# Enable peer client cert authentication. +# +# default: false +# +# ETCD_PEER_CLIENT_CERT_AUTH=false + +# Path to the peer server TLS trusted CA file. +# +# default: none +# +# ETCD_PEER_TRUSTED_CA_FILE= + +# Drop the default log level to DEBUG for all subpackages. +# +# default: false (INFO for all packages) +# +# ETCD_DEBUG=false + +# Set individual etcd subpackages to specific log levels. +# An example being etcdserver=WARNING,security=DEBUG +# +# default: none (INFO for all packages) +# +# ETCD_LOG_PACKAGE_LEVELS= + +# Force to create a new one_member cluster. +# It commits configuration changes in force to remove all existing members in the cluster and add itself. +# It needs to be set to restore a backup. +# +# default: false +# +# ETCD_FORCE_NEW_CLUSTER=false + +# vim:ft=sh: + diff --git a/testing/etcd/etcd.initd b/testing/etcd/etcd.initd new file mode 100644 index 00000000000..4780434fcbd --- /dev/null +++ b/testing/etcd/etcd.initd @@ -0,0 +1,37 @@ +#!/sbin/openrc-run +# Copyright 2016 Alpine Linux +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +depend() { + need net +} + +start_pre() { + checkpath -d -m 0775 -o $USER:$USER $PIDPATH + checkpath -d -m 0775 -o $USER:$USER $LOGPATH + checkpath -d -m 0775 -o $USER:$USER $ETCD_DATA_DIR +} + +start() { + ebegin "Starting $SVCNAME" + start-stop-daemon --start \ + --pidfile "$PIDFILE" \ + --user $USER \ + --chdir "$ETCD_DATA_DIR" \ + --background \ + --make-pidfile \ + --exec /usr/bin/etcd -- \ + -name=$ETCD_NAME \ + -data-dir="$ETCD_DATA_DIR" \ + $ETCD_OPTS + eend $? "Failed to start $SVCNAME" +} + +stop() { + ebegin "Stopping $SVCNAME" + start-stop-daemon --stop --pidfile $PIDFILE + eend $? "Failed to stop $SVCNAME" + rm -f "$PIDFILE" +} + diff --git a/testing/etcd/etcd.pre-install b/testing/etcd/etcd.pre-install new file mode 100755 index 00000000000..a3226fb7f55 --- /dev/null +++ b/testing/etcd/etcd.pre-install @@ -0,0 +1,4 @@ +#!/bin/sh +addgroup -S etcd 2>/dev/null +adduser -S -D -H -h /dev/null -s /sbin/nologin -G etcd -g etcd etcd 2>/dev/null +exit 0 |