diff options
author | mrxx | 2019-05-07 16:54:22 +0200 |
---|---|---|
committer | mrxx | 2019-05-07 16:54:22 +0200 |
commit | 462716b6bdaf0bef90c3650973719316e96a986a (patch) | |
tree | fa2450040c4dad99981ce5028ddf783d28e8606b | |
parent | d4f10f416e30210f239f2ecbb1fcd23d51049a54 (diff) | |
download | aur-462716b6bdaf0bef90c3650973719316e96a986a.tar.gz |
Update to 0.18.1; rename some files from bitcoin to bitcoind; set datadir to /var/lib/bitcoind
-rw-r--r-- | .SRCINFO | 25 | ||||
-rw-r--r-- | PKGBUILD | 36 | ||||
-rw-r--r-- | bitcoin-core-02-chown.hook | 2 | ||||
-rw-r--r-- | bitcoin-core-02-rm-rf.hook | 2 | ||||
-rw-r--r-- | bitcoin-reindex.service | 28 | ||||
-rw-r--r-- | bitcoin.service | 27 | ||||
-rw-r--r-- | bitcoind-reindex.service | 69 | ||||
-rw-r--r-- | bitcoind.install (renamed from bitcoin.install) | 10 | ||||
-rw-r--r-- | bitcoind.logrotate (renamed from bitcoin.logrotate) | 2 | ||||
-rw-r--r-- | bitcoind.service | 68 |
10 files changed, 179 insertions, 90 deletions
@@ -1,9 +1,9 @@ pkgbase = bitcoin-core pkgdesc = Bitcoin Core headless P2P node - pkgver = 0.17.1 + pkgver = 0.18.0 pkgrel = 1 url = https://bitcoincore.org - install = bitcoin.install + install = bitcoind.install arch = aarch64 arch = armv6h arch = armv7h @@ -32,26 +32,27 @@ pkgbase = bitcoin-core conflicts = bitcoin-tx backup = etc/bitcoin/bitcoin.conf backup = etc/logrotate.d/bitcoin - source = https://bitcoincore.org/bin/bitcoin-core-0.17.1/bitcoin-0.17.1.tar.gz + backup = etc/logrotate.d/bitcoind + source = https://bitcoincore.org/bin/bitcoin-core-0.18.0/bitcoin-0.18.0.tar.gz source = bitcoin.conf - source = bitcoin.logrotate - source = bitcoin.service - source = bitcoin-reindex.service + source = bitcoind.logrotate + source = bitcoind.service + source = bitcoind-reindex.service source = bitcoin-sysusers.conf source = bitcoin-core-01-systemd-sysusers.hook source = bitcoin-core-01-userdel.hook source = bitcoin-core-02-chown.hook source = bitcoin-core-02-rm-rf.hook - sha256sums = 3e564fb5cf832f39e930e19c83ea53e09cfe6f93a663294ed83a32e194bda42a + sha256sums = 5e4e6890e07b620a93fdb24605dae2bb53e8435b2a93d37558e1db1913df405f sha256sums = b1908344281498d39bfa40c3b9725f9c95bf22602cd46e6120a1f17bad9dae35 - sha256sums = 8f05207b586916d489b7d25a68eaacf6e678d7cbb5bfbac551903506b32f904f - sha256sums = e56dc913b82097acdc20374a2ae1b08323af74ccbbf63c829d4d13c9cb63ad8d - sha256sums = 4d5053ba94fa647abc6abe8b90f46d4c61d706de8fb0151f6aefed772adf317e + sha256sums = 7bf4bdad419c1ee30b88c7e4190707c5ff250da8b23d68d5adf14043f8e2ac73 + sha256sums = 1cdef0c3e6247db69f1ba7fb14bd334809b7cc124dfbfb98ed7d513fb70f883e + sha256sums = 1599e673c58414408d5911d1748f07dba2a093e053f87c013652a06078b186ee sha256sums = f126b4824e43d9760ab2021460a37d859986f07e1ac9245ee4938e832739f73a sha256sums = 0b4f7ec41cf88aa1278d089a03f116c33bac62dec038903f4ced58da67afb980 sha256sums = f1c3727220df06993a61cc9f4ef25c83cdaf3624179b5ead8383bc9ef7109e70 - sha256sums = ae31040f0cc57df976c6ed41e8f69ed4b947db32ba713c7a0b7410108dbf5581 - sha256sums = b8e574f4b56c81a05a05f5bf59b28120b782d00354b08bd43c641038704e07a5 + sha256sums = 2fc4d1b5ad05dbed9f1759951c9a96f4e00c7fd45fd45f16f73cff674e836af3 + sha256sums = 135addcc23c3b58c907618625aeb54e068fe5a6d996e14146c197e6e164027d3 pkgname = bitcoin-core @@ -2,7 +2,7 @@ # Contributor: Andy Weidenbaum <archbaum@gmail.com> pkgname=bitcoin-core -pkgver=0.17.1 +pkgver=0.18.0 pkgrel=1 pkgdesc="Bitcoin Core headless P2P node" arch=('aarch64' 'armv6h' 'armv7h' 'i686' 'x86_64') @@ -13,29 +13,30 @@ makedepends=('autoconf' 'automake' 'binutils' 'libtool' 'm4' 'make' 'pkg-config' license=('MIT') source=(https://bitcoincore.org/bin/bitcoin-core-$pkgver/bitcoin-$pkgver.tar.gz bitcoin.conf - bitcoin.logrotate - bitcoin.service - bitcoin-reindex.service + bitcoind.logrotate + bitcoind.service + bitcoind-reindex.service bitcoin-sysusers.conf bitcoin-core-01-systemd-sysusers.hook bitcoin-core-01-userdel.hook bitcoin-core-02-chown.hook bitcoin-core-02-rm-rf.hook) -sha256sums=('3e564fb5cf832f39e930e19c83ea53e09cfe6f93a663294ed83a32e194bda42a' +sha256sums=('5e4e6890e07b620a93fdb24605dae2bb53e8435b2a93d37558e1db1913df405f' 'b1908344281498d39bfa40c3b9725f9c95bf22602cd46e6120a1f17bad9dae35' - '8f05207b586916d489b7d25a68eaacf6e678d7cbb5bfbac551903506b32f904f' - 'e56dc913b82097acdc20374a2ae1b08323af74ccbbf63c829d4d13c9cb63ad8d' - '4d5053ba94fa647abc6abe8b90f46d4c61d706de8fb0151f6aefed772adf317e' + '7bf4bdad419c1ee30b88c7e4190707c5ff250da8b23d68d5adf14043f8e2ac73' + '1cdef0c3e6247db69f1ba7fb14bd334809b7cc124dfbfb98ed7d513fb70f883e' + '1599e673c58414408d5911d1748f07dba2a093e053f87c013652a06078b186ee' 'f126b4824e43d9760ab2021460a37d859986f07e1ac9245ee4938e832739f73a' '0b4f7ec41cf88aa1278d089a03f116c33bac62dec038903f4ced58da67afb980' 'f1c3727220df06993a61cc9f4ef25c83cdaf3624179b5ead8383bc9ef7109e70' - 'ae31040f0cc57df976c6ed41e8f69ed4b947db32ba713c7a0b7410108dbf5581' - 'b8e574f4b56c81a05a05f5bf59b28120b782d00354b08bd43c641038704e07a5') + '2fc4d1b5ad05dbed9f1759951c9a96f4e00c7fd45fd45f16f73cff674e836af3' + '135addcc23c3b58c907618625aeb54e068fe5a6d996e14146c197e6e164027d3') backup=('etc/bitcoin/bitcoin.conf' - 'etc/logrotate.d/bitcoin') + 'etc/logrotate.d/bitcoin' + 'etc/logrotate.d/bitcoind') provides=('bitcoin-cli' 'bitcoin-daemon' 'bitcoin-tx') conflicts=('bitcoin-cli' 'bitcoin-daemon' 'bitcoin-qt' 'bitcoin-tx') -install=bitcoin.install +install=bitcoind.install # half of available processing units or one if only one is available _nproc=$(($(nproc)/2)) @@ -85,7 +86,6 @@ package() { msg2 'Installing essential directories' install -dm 700 "$pkgdir/etc/bitcoin" - install -dm 755 "$pkgdir/srv/bitcoin" msg2 'Installing bitcoin...' make DESTDIR="$pkgdir" install @@ -93,17 +93,17 @@ package() { msg2 'Installing bitcoin.conf...' install -Dm 600 "$srcdir/bitcoin.conf" -t "$pkgdir/etc/bitcoin" - msg2 'Installing bitcoin.service...' - install -Dm 644 "$srcdir/bitcoin.service" -t "$pkgdir/usr/lib/systemd/system" - install -Dm 644 "$srcdir/bitcoin-reindex.service" \ + msg2 'Installing bitcoind.service...' + install -Dm 644 "$srcdir/bitcoind.service" -t "$pkgdir/usr/lib/systemd/system" + install -Dm 644 "$srcdir/bitcoind-reindex.service" \ -t "$pkgdir/usr/lib/systemd/system" msg2 'Installing bitcoin-sysusers.conf...' install -Dm 644 "$srcdir/bitcoin-sysusers.conf" \ "$pkgdir/usr/lib/sysusers.d/bitcoin.conf" - msg2 'Installing bitcoin.logrotate...' - install -Dm 644 "$srcdir/bitcoin.logrotate" "$pkgdir/etc/logrotate.d/bitcoin" + msg2 'Installing bitcoind.logrotate...' + install -Dm 644 "$srcdir/bitcoind.logrotate" "$pkgdir/etc/logrotate.d/bitcoind" msg2 'Installing bash completion...' for _compl in bitcoin-cli bitcoin-tx bitcoind; do diff --git a/bitcoin-core-02-chown.hook b/bitcoin-core-02-chown.hook index 3e1b93b4719f..d83277db405e 100644 --- a/bitcoin-core-02-chown.hook +++ b/bitcoin-core-02-chown.hook @@ -8,4 +8,4 @@ Target = bitcoin-core Description = Setting bitcoin daemon user directory permissions... Depends = coreutils When = PostTransaction -Exec = /usr/bin/chown -R bitcoin:bitcoin /etc/bitcoin /srv/bitcoin +Exec = /usr/bin/chown -R bitcoin:bitcoin /etc/bitcoin /var/lib/bitcoind diff --git a/bitcoin-core-02-rm-rf.hook b/bitcoin-core-02-rm-rf.hook index da96a2323152..fa8e20f8f7d9 100644 --- a/bitcoin-core-02-rm-rf.hook +++ b/bitcoin-core-02-rm-rf.hook @@ -7,4 +7,4 @@ Target = bitcoin-core Description = Cleaning up bitcoin daemon user directories... Depends = coreutils When = PostTransaction -Exec = /usr/bin/rm -rf /srv/bitcoin +Exec = /usr/bin/rm -rf /srv/bitcoin /var/lib/bitcoind diff --git a/bitcoin-reindex.service b/bitcoin-reindex.service deleted file mode 100644 index 3fea38690795..000000000000 --- a/bitcoin-reindex.service +++ /dev/null @@ -1,28 +0,0 @@ -[Unit] -Description=Bitcoin Daemon (reindex) -Conflicts=bitcoin.service -After=network.target - -[Service] -Type=forking -User=bitcoin -Group=bitcoin -ExecStart=/usr/bin/bitcoind -daemon \ - -conf=/etc/bitcoin/bitcoin.conf \ - -datadir=/srv/bitcoin \ - -reindex \ - -pid=/run/bitcoin/bitcoind.pid -ExecReload=/usr/bin/kill -HUP $MAINPID -ExecStop=/usr/bin/bitcoind stop -Restart=on-failure -RuntimeDirectory=bitcoin -PIDFile=/run/bitcoin/bitcoind.pid -MemoryDenyWriteExecute=true -NoNewPrivileges=true -PrivateDevices=true -PrivateTmp=true -ProtectSystem=full -SystemCallArchitectures=native - -[Install] -WantedBy=multi-user.target diff --git a/bitcoin.service b/bitcoin.service deleted file mode 100644 index 58197742fb28..000000000000 --- a/bitcoin.service +++ /dev/null @@ -1,27 +0,0 @@ -[Unit] -Description=Bitcoin Daemon -Conflicts=bitcoin-reindex.service -After=network.target - -[Service] -Type=forking -User=bitcoin -Group=bitcoin -ExecStart=/usr/bin/bitcoind -daemon \ - -conf=/etc/bitcoin/bitcoin.conf \ - -datadir=/srv/bitcoin \ - -pid=/run/bitcoin/bitcoind.pid -ExecReload=/usr/bin/kill -HUP $MAINPID -ExecStop=/usr/bin/bitcoind stop -Restart=on-failure -RuntimeDirectory=bitcoin -PIDFile=/run/bitcoin/bitcoind.pid -MemoryDenyWriteExecute=true -NoNewPrivileges=true -PrivateDevices=true -PrivateTmp=true -ProtectSystem=full -SystemCallArchitectures=native - -[Install] -WantedBy=multi-user.target diff --git a/bitcoind-reindex.service b/bitcoind-reindex.service new file mode 100644 index 000000000000..65ebd4492ebb --- /dev/null +++ b/bitcoind-reindex.service @@ -0,0 +1,69 @@ +# It is not recommended to modify this file in-place, because it will +# be overwritten during package upgrades. If you want to add further +# options or overwrite existing ones then use +# $ systemctl edit bitcoind.service +# See "man systemd.service" for details. + +# Note that almost all daemon options could be specified in +# /etc/bitcoin/bitcoin.conf, except for those explicitly specified as arguments +# in ExecStart= + +[Unit] +Description=Bitcoin daemon (reindex) +After=network.target + +[Service] +ExecStart=/usr/bin/bitcoind -daemon \ + -pid=/run/bitcoind/bitcoind.pid \ + -conf=/etc/bitcoin/bitcoin.conf \ + -reindex \ + -datadir=/var/lib/bitcoind + +# Process management +#################### + +Type=forking +PIDFile=/run/bitcoind/bitcoind.pid +Restart=on-failure + +# Directory creation and permissions +#################################### + +# Run as bitcoin:bitcoin +User=bitcoin +Group=bitcoin + +# /run/bitcoind +RuntimeDirectory=bitcoind +RuntimeDirectoryMode=0710 + +# /etc/bitcoin +ConfigurationDirectory=bitcoin +ConfigurationDirectoryMode=0710 + +# /var/lib/bitcoind +StateDirectory=bitcoind +StateDirectoryMode=0710 + +# Hardening measures +#################### + +# Provide a private /tmp and /var/tmp. +PrivateTmp=true + +# Mount /usr, /boot/ and /etc read-only for the process. +ProtectSystem=full + +# Disallow the process and all of its children to gain +# new privileges through execve(). +NoNewPrivileges=true + +# Use a new /dev namespace only populated with API pseudo devices +# such as /dev/null, /dev/zero and /dev/random. +PrivateDevices=true + +# Deny the creation of writable and executable memory mappings. +MemoryDenyWriteExecute=true + +[Install] +WantedBy=multi-user.target diff --git a/bitcoin.install b/bitcoind.install index b2bb6701a89b..fc8c1e075a76 100644 --- a/bitcoin.install +++ b/bitcoind.install @@ -1,8 +1,14 @@ post_install() { + # Create data directory if it doesn't exist yet + mkdir -p -m 755 /var/lib/bitcoind printf "%b\n" "$bitcoin" } post_upgrade() { + # Ensure a previous blockchain in the old datadir is kept in use + if [ -f /srv/bitcoin/peers.dat ] && [ ! -d /var/lib/bitcoind ]; then + ln -s /srv/bitcoin /var/lib/bitcoind + fi post_install } @@ -15,7 +21,7 @@ read -d '' bitcoin <<'EOF' ## ## ## To start bitcoin-core: ## ## ## -## # systemctl start bitcoin ## +## # systemctl start bitcoind ## ## ## ## To communicate with bitcoin-core as a normal user: ## ## ## @@ -30,7 +36,7 @@ read -d '' bitcoin <<'EOF' ## $ bitcoin-cli getmininginfo ## ## ## ## Config: /etc/bitcoin/bitcoin.conf ## -## Blockchain: /srv/bitcoin ## +## Blockchain: /var/lib/bitcoind ## ## Documentation: /usr/share/doc/bitcoin ## ## ## ######################################################################## diff --git a/bitcoin.logrotate b/bitcoind.logrotate index fe13fb2e7049..159f63f266ce 100644 --- a/bitcoin.logrotate +++ b/bitcoind.logrotate @@ -1,4 +1,4 @@ -/srv/bitcoin/debug.log +/var/lib/bitcoind/debug.log { rotate 5 copytruncate diff --git a/bitcoind.service b/bitcoind.service new file mode 100644 index 000000000000..cfc5f775800d --- /dev/null +++ b/bitcoind.service @@ -0,0 +1,68 @@ +# It is not recommended to modify this file in-place, because it will +# be overwritten during package upgrades. If you want to add further +# options or overwrite existing ones then use +# $ systemctl edit bitcoind.service +# See "man systemd.service" for details. + +# Note that almost all daemon options could be specified in +# /etc/bitcoin/bitcoin.conf, except for those explicitly specified as arguments +# in ExecStart= + +[Unit] +Description=Bitcoin daemon +After=network.target + +[Service] +ExecStart=/usr/bin/bitcoind -daemon \ + -pid=/run/bitcoind/bitcoind.pid \ + -conf=/etc/bitcoin/bitcoin.conf \ + -datadir=/var/lib/bitcoind + +# Process management +#################### + +Type=forking +PIDFile=/run/bitcoind/bitcoind.pid +Restart=on-failure + +# Directory creation and permissions +#################################### + +# Run as bitcoin:bitcoin +User=bitcoin +Group=bitcoin + +# /run/bitcoind +RuntimeDirectory=bitcoind +RuntimeDirectoryMode=0710 + +# /etc/bitcoin +ConfigurationDirectory=bitcoin +ConfigurationDirectoryMode=0710 + +# /var/lib/bitcoind +StateDirectory=bitcoind +StateDirectoryMode=0710 + +# Hardening measures +#################### + +# Provide a private /tmp and /var/tmp. +PrivateTmp=true + +# Mount /usr, /boot/ and /etc read-only for the process. +ProtectSystem=full + +# Disallow the process and all of its children to gain +# new privileges through execve(). +NoNewPrivileges=true + +# Use a new /dev namespace only populated with API pseudo devices +# such as /dev/null, /dev/zero and /dev/random. +PrivateDevices=true + +# Deny the creation of writable and executable memory mappings. +MemoryDenyWriteExecute=true + +[Install] +WantedBy=multi-user.target |