summarylogtreecommitdiffstats
path: root/bitcoin.install
diff options
context:
space:
mode:
Diffstat (limited to 'bitcoin.install')
-rw-r--r--bitcoin.install50
1 files changed, 0 insertions, 50 deletions
diff --git a/bitcoin.install b/bitcoin.install
deleted file mode 100644
index a42cd1eea7e..00000000000
--- a/bitcoin.install
+++ /dev/null
@@ -1,50 +0,0 @@
-_bc_user=bitcoin
-_bc_group=bitcoin
-
-post_install() {
- _mkuser
- _dir="/var/lib/bitcoind"
- _cnf="/etc/bitcoin"
- if test ! -d "$_dir"; then
- mkdir -m 750 "$_dir"
- # disable Copy-On-Write (btrfs directories only)
- # This avoids lots of known db-corruption issues
- _is_btrfs "$_dir" && chattr +C "$_dir"
- fi
- chown -R $_bc_user:$_bc_group "$_dir" "$_cnf"
- chmod 775 "$_cnf"
- printf "%b\n" "$bitcoin"
-}
-
-post_upgrade() {
- _mkuser
- printf "%b\n" "$bitcoin"
-}
-
-
-# ------------------------------------------------------------------------------
-# helper functions for creating bitcoin user / group
-# ------------------------------------------------------------------------------
-
-_mkuser() {
- getent passwd $_bc_user &>/dev/null || {
- echo -n "Creating bitcoin user... "
- grep -E "^$_bc_group:" /etc/group >/dev/null || groupadd $_bc_group
- useradd -m -d /etc/bitcoin -g $_bc_group -s /usr/bin/nologin $_bc_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
-}