From 24781a50b4203544284039f8aca359e794a3dd73 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Tue, 8 Dec 2020 08:42:45 -0500 Subject: [PATCH] yep --- contrib/init/bitcoind.conf | 65 ------------------- contrib/init/hushd.conf | 65 +++++++++++++++++++ contrib/init/{bitcoind.init => hushd.init} | 0 .../init/{bitcoind.openrc => hushd.openrc} | 0 .../{bitcoind.openrcconf => hushd.openrcconf} | 0 .../init/{bitcoind.service => hushd.service} | 0 6 files changed, 65 insertions(+), 65 deletions(-) delete mode 100644 contrib/init/bitcoind.conf create mode 100644 contrib/init/hushd.conf rename contrib/init/{bitcoind.init => hushd.init} (100%) rename contrib/init/{bitcoind.openrc => hushd.openrc} (100%) rename contrib/init/{bitcoind.openrcconf => hushd.openrcconf} (100%) rename contrib/init/{bitcoind.service => hushd.service} (100%) diff --git a/contrib/init/bitcoind.conf b/contrib/init/bitcoind.conf deleted file mode 100644 index f9554eecd..000000000 --- a/contrib/init/bitcoind.conf +++ /dev/null @@ -1,65 +0,0 @@ -description "Bitcoin Core Daemon" - -start on runlevel [2345] -stop on starting rc RUNLEVEL=[016] - -env BITCOIND_BIN="/usr/bin/bitcoind" -env BITCOIND_USER="bitcoin" -env BITCOIND_GROUP="bitcoin" -env BITCOIND_PIDDIR="/var/run/bitcoind" -# upstart can't handle variables constructed with other variables -env BITCOIND_PIDFILE="/var/run/bitcoind/bitcoind.pid" -env BITCOIND_CONFIGFILE="/etc/bitcoin/bitcoin.conf" -env BITCOIND_DATADIR="/var/lib/bitcoind" - -expect fork - -respawn -respawn limit 5 120 -kill timeout 60 - -pre-start script - # this will catch non-existent config files - # bitcoind will check and exit with this very warning, but it can do so - # long after forking, leaving upstart to think everything started fine. - # since this is a commonly encountered case on install, just check and - # warn here. - if ! grep -qs '^rpcpassword=' "$BITCOIND_CONFIGFILE" ; then - echo "ERROR: You must set a secure rpcpassword to run bitcoind." - echo "The setting must appear in $BITCOIND_CONFIGFILE" - echo - echo "This password is security critical to securing wallets " - echo "and must not be the same as the rpcuser setting." - echo "You can generate a suitable random password using the following" - echo "command from the shell:" - echo - echo "bash -c 'tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo'" - echo - echo "It is also recommended that you also set alertnotify so you are " - echo "notified of problems:" - echo - echo "ie: alertnotify=echo %%s | mail -s \"Bitcoin Alert\"" \ - "admin@foo.com" - echo - exit 1 - fi - - mkdir -p "$BITCOIND_PIDDIR" - chmod 0755 "$BITCOIND_PIDDIR" - chown $BITCOIND_USER:$BITCOIND_GROUP "$BITCOIND_PIDDIR" - chown $BITCOIND_USER:$BITCOIND_GROUP "$BITCOIND_CONFIGFILE" - chmod 0660 "$BITCOIND_CONFIGFILE" -end script - -exec start-stop-daemon \ - --start \ - --pidfile "$BITCOIND_PIDFILE" \ - --chuid $BITCOIND_USER:$BITCOIND_GROUP \ - --exec "$BITCOIND_BIN" \ - -- \ - -pid="$BITCOIND_PIDFILE" \ - -conf="$BITCOIND_CONFIGFILE" \ - -datadir="$BITCOIND_DATADIR" \ - -disablewallet \ - -daemon - diff --git a/contrib/init/hushd.conf b/contrib/init/hushd.conf new file mode 100644 index 000000000..649df7796 --- /dev/null +++ b/contrib/init/hushd.conf @@ -0,0 +1,65 @@ +description "Hush Daemon" + +start on runlevel [2345] +stop on starting rc RUNLEVEL=[016] + +env HUSHD_BIN="/usr/bin/hushd" +env HUSHD_USER="hush" +env HUSHD_GROUP="hush" +env HUSHD_PIDDIR="/var/run/hushd" +# upstart can't handle variables constructed with other variables +env HUSHD_PIDFILE="/var/run/hushd/hushd.pid" +env HUSHD_CONFIGFILE="/etc/hush/hush.conf" +env HUSHD_DATADIR="/var/lib/hushd" + +expect fork + +respawn +respawn limit 5 120 +kill timeout 60 + +pre-start script + # this will catch non-existent config files + # hushd will check and exit with this very warning, but it can do so + # long after forking, leaving upstart to think everything started fine. + # since this is a commonly encountered case on install, just check and + # warn here. + if ! grep -qs '^rpcpassword=' "$HUSHD_CONFIGFILE" ; then + echo "ERROR: You must set a secure rpcpassword to run hushd." + echo "The setting must appear in $HUSHD_CONFIGFILE" + echo + echo "This password is security critical to securing wallets " + echo "and must not be the same as the rpcuser setting." + echo "You can generate a suitable random password using the following" + echo "command from the shell:" + echo + echo "bash -c 'tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo'" + echo + echo "It is also recommended that you also set alertnotify so you are " + echo "notified of problems:" + echo + echo "ie: alertnotify=echo %%s | mail -s \"Hush Alert\"" \ + "admin@foo.com" + echo + exit 1 + fi + + mkdir -p "$HUSHD_PIDDIR" + chmod 0755 "$HUSHD_PIDDIR" + chown $HUSHD_USER:$HUSHD_GROUP "$HUSHD_PIDDIR" + chown $HUSHD_USER:$HUSHD_GROUP "$HUSHD_CONFIGFILE" + chmod 0660 "$HUSHD_CONFIGFILE" +end script + +exec start-stop-daemon \ + --start \ + --pidfile "$HUSHD_PIDFILE" \ + --chuid $HUSHD_USER:$HUSHD_GROUP \ + --exec "$HUSHD_BIN" \ + -- \ + -pid="$HUSHD_PIDFILE" \ + -conf="$HUSHD_CONFIGFILE" \ + -datadir="$HUSHD_DATADIR" \ + -disablewallet \ + -daemon + diff --git a/contrib/init/bitcoind.init b/contrib/init/hushd.init similarity index 100% rename from contrib/init/bitcoind.init rename to contrib/init/hushd.init diff --git a/contrib/init/bitcoind.openrc b/contrib/init/hushd.openrc similarity index 100% rename from contrib/init/bitcoind.openrc rename to contrib/init/hushd.openrc diff --git a/contrib/init/bitcoind.openrcconf b/contrib/init/hushd.openrcconf similarity index 100% rename from contrib/init/bitcoind.openrcconf rename to contrib/init/hushd.openrcconf diff --git a/contrib/init/bitcoind.service b/contrib/init/hushd.service similarity index 100% rename from contrib/init/bitcoind.service rename to contrib/init/hushd.service