diff options
author | jgmdev | 2018-02-09 12:24:17 -0400 |
---|---|---|
committer | jgmdev | 2018-02-09 12:24:17 -0400 |
commit | 0dda3db6f064fb475ae3e781ca27fdd2702f696c (patch) | |
tree | 6e9c5d58e6ab7059e629bdfe657862dd75e2a4ef | |
parent | c03072433c298279f51e28aeb11945e7fe0625ac (diff) | |
download | aur-0dda3db6f064fb475ae3e781ca27fdd2702f696c.tar.gz |
Added support for bedrock.conf file and fixed improper delete of main database.
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 10 | ||||
-rw-r--r-- | bedrock.conf | 55 | ||||
-rw-r--r-- | bedrock.install | 9 | ||||
-rw-r--r-- | bedrock.service | 3 |
5 files changed, 78 insertions, 5 deletions
@@ -1,17 +1,21 @@ # Generated by mksrcinfo v8 -# Fri Feb 9 14:39:45 UTC 2018 +# Fri Feb 9 16:23:34 UTC 2018 pkgbase = bedrock pkgdesc = Rock solid distributed database specializing in active/active automatic failover and WAN replication. pkgver = r1323.649c63f pkgrel = 1 url = http://bedrockdb.com + install = bedrock.install arch = i686 arch = x86_64 license = GPL + backup = etc/bedrock.conf source = git://github.com/Expensify/Bedrock + source = bedrock.conf source = bedrock.service sha512sums = SKIP sha512sums = SKIP + sha512sums = SKIP pkgname = bedrock @@ -8,11 +8,14 @@ pkgdesc="Rock solid distributed database specializing in active/active automatic url="http://bedrockdb.com" license=("GPL") arch=('i686' 'x86_64') +install=$pkgname.install source=( 'git://github.com/Expensify/Bedrock' + 'bedrock.conf' 'bedrock.service' ) -sha512sums=('SKIP' 'SKIP') +sha512sums=('SKIP' 'SKIP' 'SKIP') +backup=('etc/bedrock.conf') pkgver() { cd "${srcdir}/${_gitname}" @@ -51,9 +54,9 @@ package() { install -Dm755 bedrock $pkgdir/usr/bin/bedrock - install -d ${pkgdir}/var/lib/bedrock/ + install -d ${pkgdir}/etc/ - touch ${pkgdir}/var/lib/bedrock/bedrock.db + install -d ${pkgdir}/var/lib/bedrock/ install -d "$pkgdir/usr/share/doc/$pkgname" @@ -61,5 +64,6 @@ package() { cd ../../ + install -Dm644 bedrock.conf $pkgdir/etc/bedrock.conf install -Dm755 bedrock.service $pkgdir/usr/lib/systemd/system/bedrock.service } diff --git a/bedrock.conf b/bedrock.conf new file mode 100644 index 000000000000..bbbe3c7655a5 --- /dev/null +++ b/bedrock.conf @@ -0,0 +1,55 @@ +# +# Bedrock configuration file. +# +# You must explicitly add the list of nodes on the cluster in +# BEDROCK_EXTRA_ARGS, using the -peerList switch. Run bedrock -h +# to read all options. +# +# Remember to modify your /etc/hosts file to include the ip addresses +# of each node given on the -peerList option. The NODE_NAME must be +# the name that is going to be given into the -peerList option of +# other nodes. +# +# You can use openvpn to securely establish a connection with other +# nodes. +# + +# Name this specfic node in the cluster. This should usually +# be set to your hostname. +# Sets -nodeName flag +NODE_NAME=localhost + +# Path to the database file. +# Sets -db flag +DATABASE=/var/lib/bedrock/bedrock.db + +# Listen on this host:port for cluster connections. +# Sets -serverHost flag +SERVER_HOST=localhost:8888 + +# Listen on this host:port for connections from other nodes. +# Sets -nodeHost flag +NODE_HOST=localhost:8889 + +# The bedrock process priority. +# Sets -priority flag +PRIORITY=100 + +# Sets the -pidfile flag +PIDFILE=/var/run/bedrock.pid + +# Comma separated list of plugins to enable. +# Sets -plugins flag +PLUGINS="db,jobs,cache,mysql" + +# Number of worker threads to start (min: 1). This should be set to +# the total amount of cores on this machine for best performance. +# Sets -workerThreads flag +WORKER_THREADS=1 + +# Number of KB to allocate for a page cache. +# Sets -cacheSize Flag +CACHE_SIZE=1048576 + +# Here you can set additional options like the -peerList. +BEDROCK_EXTRA_ARGS="-v" diff --git a/bedrock.install b/bedrock.install new file mode 100644 index 000000000000..c774cee60cd4 --- /dev/null +++ b/bedrock.install @@ -0,0 +1,9 @@ +post_install() { + if [ ! -e "/var/lib/bedrock/bedrock.db" ]; then + touch /var/lib/bedrock/bedrock.db + fi +} + +post_upgrade() { + post_install +} diff --git a/bedrock.service b/bedrock.service index 2a1d0d5ca499..dcca3dffe0bd 100644 --- a/bedrock.service +++ b/bedrock.service @@ -5,7 +5,8 @@ After=network.target remote-fs.target nss-lookup.target [Service] Type=simple SyslogIdentifier=bedrock -ExecStart= /usr/bin/bedrock -db /var/lib/bedrock/bedrock.db -serverHost 0.0.0.0:8888 -nodeHost 0.0.0.0:8889 -priority 200 -pidfile /var/run/bedrock.pid -quorumCheckpoint 100 -readThreads 4 -plugins db,jobs,cache,mysql -v -cache 10001 +EnvironmentFile=/etc/bedrock.conf +ExecStart=/usr/bin/bedrock -nodeName $NODE_NAME -db $DATABASE -serverHost $SERVER_HOST -nodeHost $NODE_HOST -priority $PRIORITY -pidfile $PIDFILE -workerThreads $WORKER_THREADS -plugins $PLUGINS -cacheSize $CACHE_SIZE $BEDROCK_EXTRA_ARGS TimeoutSec=10 [Install] |