summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Weidenbaum2017-03-09 15:45:08 -0800
committerAndy Weidenbaum2017-03-09 15:45:08 -0800
commit6bec76bb520e9f0db1ed09602c76c479494955d2 (patch)
tree0153e7a6cff24d7ef8537e487c541bed4050461c
parent08bce7915b9e8433385240be37509515bc7563f9 (diff)
downloadaur-6bec76bb520e9f0db1ed09602c76c479494955d2.tar.gz
increment pkgrel to 3; obelisk
-rw-r--r--.SRCINFO15
-rw-r--r--PKGBUILD34
-rw-r--r--bs-init.service12
-rw-r--r--bs.install94
-rw-r--r--bs.logrotate4
-rw-r--r--bs.service10
-rw-r--r--bsinit.service12
7 files changed, 52 insertions, 129 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 497e183acae..7722aaf20fe 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,14 +1,15 @@
# Generated by mksrcinfo v8
-# Wed Mar 8 20:26:53 UTC 2017
+# Thu Mar 9 23:43:48 UTC 2017
pkgbase = libbitcoin-server-git
pkgdesc = Bitcoin Full Node and Query Server
pkgver = 20170307
- pkgrel = 2
+ pkgrel = 3
url = https://github.com/libbitcoin/libbitcoin-server
install = bs.install
arch = i686
arch = x86_64
groups = libbitcoin
+ groups = obelisk
license = AGPL3
makedepends = autoconf
makedepends = automake
@@ -33,18 +34,18 @@ pkgbase = libbitcoin-server-git
optdepends = libbitcoin-explorer: CurveZMQ client/server authentication
provides = libbitcoin-server
conflicts = libbitcoin-server
- backup = etc/bs/bs.cfg
+ backup = etc/obelisk/bs/bs.cfg
backup = etc/logrotate.d/bs
source = git+https://github.com/libbitcoin/libbitcoin-server
source = git+https://github.com/libbitcoin/libbitcoin-server.wiki
source = bs.logrotate
+ source = bs-init.service
source = bs.service
- source = bsinit.service
sha256sums = SKIP
sha256sums = SKIP
- sha256sums = 09ea3d2bf7cb87a0760c2a73893d62d1868d232c9e925cabf6140b1b031efee3
- sha256sums = 564112d0860f1523049bd89779e1b1bfc189a3d143d2cc808441981ed793658a
- sha256sums = 2bcf3615cd8e5ba6d4c78429b018b9bf756d5fad6ab879963a13f19e47315c7d
+ sha256sums = a2e4a1d6aaabcec9c57207a7e92b004c2dfa4a2d15c0ecfc05eefbf307783a49
+ sha256sums = f110eb59cdd18a8ad0a512604370f912e65b0525e8bb08b463af3e62a920b47d
+ sha256sums = 9a9a2286d7c38df7e1942838a19b430e2af6d80324202a117c7ebe2acf50cc80
pkgname = libbitcoin-server-git
diff --git a/PKGBUILD b/PKGBUILD
index 2a643546c6d..8251f6cd14a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=libbitcoin-server-git
pkgver=20170307
-pkgrel=2
+pkgrel=3
pkgdesc="Bitcoin Full Node and Query Server"
arch=('i686' 'x86_64')
depends=('boost'
@@ -26,20 +26,20 @@ makedepends=('autoconf'
'make'
'pkg-config')
optdepends=('libbitcoin-explorer: CurveZMQ client/server authentication')
-groups=('libbitcoin')
+groups=('libbitcoin' 'obelisk')
url="https://github.com/libbitcoin/libbitcoin-server"
license=('AGPL3')
source=(git+https://github.com/libbitcoin/libbitcoin-server
git+https://github.com/libbitcoin/libbitcoin-server.wiki
bs.logrotate
- bs.service
- bsinit.service)
+ bs-init.service
+ bs.service)
sha256sums=('SKIP'
'SKIP'
- '09ea3d2bf7cb87a0760c2a73893d62d1868d232c9e925cabf6140b1b031efee3'
- '564112d0860f1523049bd89779e1b1bfc189a3d143d2cc808441981ed793658a'
- '2bcf3615cd8e5ba6d4c78429b018b9bf756d5fad6ab879963a13f19e47315c7d')
-backup=('etc/bs/bs.cfg'
+ 'a2e4a1d6aaabcec9c57207a7e92b004c2dfa4a2d15c0ecfc05eefbf307783a49'
+ 'f110eb59cdd18a8ad0a512604370f912e65b0525e8bb08b463af3e62a920b47d'
+ '9a9a2286d7c38df7e1942838a19b430e2af6d80324202a117c7ebe2acf50cc80')
+backup=('etc/obelisk/bs/bs.cfg'
'etc/logrotate.d/bs')
provides=('libbitcoin-server')
conflicts=('libbitcoin-server')
@@ -56,11 +56,11 @@ prepare() {
msg2 'Configuring...'
cp -dpr --no-preserve=ownership data/bs.cfg data/bs.cfg.in
sed -i \
- -e 's@^directory.*@directory = /srv/bs/db@' \
- -e 's@^debug_file.*@debug_file = /var/log/bs/debug.log@' \
- -e 's@^error_file.*@error_file = /var/log/bs/error.log@' \
- -e 's@^hosts_file.*@hosts_file = /etc/bs/hosts.cache@' \
- -e 's@^archive_directory.*@archive_directory = /var/log/bs@' \
+ -e 's@^directory.*@directory = /srv/obelisk/db@' \
+ -e 's@^debug_file.*@debug_file = /var/log/obelisk/bs/debug.log@' \
+ -e 's@^error_file.*@error_file = /var/log/obelisk/bs/error.log@' \
+ -e 's@^hosts_file.*@hosts_file = /etc/obelisk/hosts.cache@' \
+ -e 's@^archive_directory.*@archive_directory = /var/log/obelisk/bs@' \
data/bs.cfg.in
}
@@ -95,8 +95,7 @@ package() {
install -Dm 644 COPYING -t "$pkgdir/usr/share/licenses/libbitcoin-server"
msg2 'Installing...'
- install -dm 700 "$pkgdir/etc/bs"
- install -dm 755 "$pkgdir/srv/bs"
+ install -dm 755 "$pkgdir/var/log/obelisk/bs"
make DESTDIR="$pkgdir" install
msg2 'Installing documentation...'
@@ -104,14 +103,13 @@ package() {
"$pkgdir/usr/share/doc/libbitcoin-server/wiki"
msg2 'Installing conf...'
- install -Dm 600 data/bs.cfg.in "$pkgdir/etc/bs/bs.cfg"
+ install -Dm 600 data/bs.cfg.in "$pkgdir/etc/obelisk/bs/bs.cfg"
msg2 'Installing systemd service files...'
- install -Dm 644 "$srcdir/bsinit.service" -t "$pkgdir/usr/lib/systemd/system"
+ install -Dm 644 "$srcdir/bs-init.service" -t "$pkgdir/usr/lib/systemd/system"
install -Dm 644 "$srcdir/bs.service" -t "$pkgdir/usr/lib/systemd/system"
msg2 'Installing logrotate conf...'
- install -dm 755 "$pkgdir/var/log/bs"
install -Dm 644 "$srcdir/bs.logrotate" "$pkgdir/etc/logrotate.d/bs"
msg2 'Cleaning up pkgdir...'
diff --git a/bs-init.service b/bs-init.service
new file mode 100644
index 00000000000..9c8aa9334b2
--- /dev/null
+++ b/bs-init.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Bitcoin Server: initialize database in the configured directory
+Conflicts=bs.service bn-init.service bn.service
+
+[Service]
+Type=oneshot
+User=obelisk
+Group=obelisk
+ExecStart=/usr/bin/bs -i /etc/obelisk/bs/bs.cfg
+
+[Install]
+WantedBy=multi-user.target
diff --git a/bs.install b/bs.install
index 93aa3a459f7..e13210f6dfe 100644
--- a/bs.install
+++ b/bs.install
@@ -1,95 +1,19 @@
-_bs_user=bs
-_bs_group=bs
+_bs_user=obelisk
+_bs_group=obelisk
post_install() {
- _mkuser
- # disable Copy-On-Write (btrfs directories only)
- for _dir in /srv/bs /var/log/bs; do
- _is_btrfs "$_dir" && _disable_cow "$_dir"
- done
- chown -R $_bs_user:$_bs_group /etc/bs /srv/bs /var/log/bs
+ chown -R $_bs_user:$_bs_group /etc/obelisk/bs /var/log/obelisk/bs
printf "%b\n" "$obelisk"
}
post_upgrade() {
- _mkuser
- chown -R $_bs_user:$_bs_group /etc/bs /srv/bs /var/log/bs
- printf "%b\n" "$obelisk"
+ post_install
}
post_remove() {
- _rmuser
- rm -rf /etc/bs /srv/bs /var/log/bs
-}
-
-
-# ------------------------------------------------------------------------------
-# helper functions for creating libbitcoin-server user / group
-# ------------------------------------------------------------------------------
-
-_mkuser() {
- getent passwd $_bs_user &>/dev/null || {
- echo -n "Creating libbitcoin-server user... "
- grep -E "^$_bs_group:" /etc/group >/dev/null || groupadd $_bs_group
- useradd -m -d /etc/bs -g $_bs_group -s /usr/bin/nologin $_bs_user
- echo "done"
- }
-}
-
-_rmuser() {
- echo -n "Removing libbitcoin-server user... "
- userdel -rf $_bs_user 2>/dev/null
- echo "done"
-}
-
-
-# ------------------------------------------------------------------------------
-# helper functions for disabling btrfs Copy-On-Write (CoW)
-# https://wiki.archlinux.org/index.php/Btrfs#Copy-On-Write_.28CoW.29
-# ------------------------------------------------------------------------------
-
-# check if dir is btrfs
-_is_btrfs() {
- if [[ $(findmnt --target $1 --output FSTYPE --noheadings) == 'btrfs' ]]; then
- return 0
- else
- return 1
- fi
+ rm -rf /etc/obelisk/bs /var/log/obelisk/bs
}
-# disable btrfs CoW
-_chattrify() {
- # original dir, with trailing slash stripped if it exists
- _orig_dir=$( echo "$1" | sed 's@/$@@' )
-
- # if original dir exists, back it up
- [[ -d "$1" ]] && mv "$1" "${_orig_dir}"_old
-
- # re-make original dir
- mkdir -p "$1"
-
- # set permissions on re-made dir
- chmod "$2" "$1"
-
- # disable btrfs CoW on re-made dir
- chattr +C "$1"
-
- # recursive copy to restore backed up dir while maintaining disabled CoW
- [[ -d "${_orig_dir}"_old ]] \
- && find "${_orig_dir}"_old -mindepth 1 -maxdepth 1 -exec cp -R '{}' "$1" \;
-
- # set ownership on re-made dir
- chown -R $3:$4 "$1"
-
- # purge backed up dir
- [[ -d "${_orig_dir}"_old ]] && rm -rf "${_orig_dir}"_old
-}
-
-_disable_cow() {
- _chattrify "$1" "755" "$_bs_user" "$_bs_group"
-}
-
-
read -d '' obelisk <<'EOF'
########################################################################
########################################################################
@@ -99,14 +23,14 @@ read -d '' obelisk <<'EOF'
## ##
## To run: ##
## ##
-## systemctl start bsinit # first run only ##
+## systemctl start bs-init # first run only ##
## systemctl start bs ##
## ##
## ##
-## Config: /etc/bs/bs.cfg ##
-## Blockchain: /srv/bs ##
+## Config: /etc/obelisk/bs/bs.cfg ##
+## Blockchain: /srv/obelisk ##
## Documentation: /usr/share/doc/libbitcoin-server ##
-## Logs: /var/log/bs ##
+## Logs: /var/log/obelisk/bs ##
## ##
########################################################################
########################################################################
diff --git a/bs.logrotate b/bs.logrotate
index ff5f541eb65..a9276003591 100644
--- a/bs.logrotate
+++ b/bs.logrotate
@@ -1,10 +1,10 @@
-/var/log/bs/*.log {
+/var/log/obelisk/bs/*.log {
size 5M
missingok
rotate 7
compress
delaycompress
notifempty
- create 644 bs bs
+ create 644 obelisk obelisk
sharedscripts
}
diff --git a/bs.service b/bs.service
index 2ba2ad5d05e..751baa08158 100644
--- a/bs.service
+++ b/bs.service
@@ -1,12 +1,12 @@
[Unit]
-Description=Libbitcoin server: a full Bitcoin node in the global peer-to-peer network
-Conflicts=bsinit.service
+Description=Bitcoin Server: a Bitcoin full node and query server
+Conflicts=bs-init.service bn-init.service bn.service
[Service]
Type=simple
-User=bs
-Group=bs
-ExecStart=/usr/bin/bs /etc/bs/bs.cfg
+User=obelisk
+Group=obelisk
+ExecStart=/usr/bin/bs /etc/obelisk/bs/bs.cfg
ExecReload=/usr/bin/kill -s SIGHUP $MAINPID
ExecStop=/usr/bin/kill -s SIGINT $MAINPID
diff --git a/bsinit.service b/bsinit.service
deleted file mode 100644
index 6b6acfd9b1a..00000000000
--- a/bsinit.service
+++ /dev/null
@@ -1,12 +0,0 @@
-[Unit]
-Description=Libbitcoin server: initialize database in the configured directory
-Conflicts=bs.service
-
-[Service]
-Type=oneshot
-User=bs
-Group=bs
-ExecStart=/usr/bin/bs -i /etc/bs/bs.cfg
-
-[Install]
-WantedBy=multi-user.target