aboutsummaryrefslogtreecommitdiff
path: root/contrib/init/dogecoind.conf
diff options
context:
space:
mode:
authorJ Ross Nicoll <[email protected]>2015-08-15 11:36:26 +0100
committerJ Ross Nicoll <[email protected]>2015-10-31 14:49:41 +0000
commita21fa1ad61e9ceb7c2dd9e855c49edc9b70aade5 (patch)
treedd3ebe4ea1e6d3d4ba40db96768fa36fff95a7a6 /contrib/init/dogecoind.conf
parentReplace Bitcoin icons with Dogecoin (diff)
downloaddiscoin-a21fa1ad61e9ceb7c2dd9e855c49edc9b70aade5.tar.xz
discoin-a21fa1ad61e9ceb7c2dd9e855c49edc9b70aade5.zip
s/bitcoin/dogecoin/ in init scripts
Diffstat (limited to 'contrib/init/dogecoind.conf')
-rw-r--r--contrib/init/dogecoind.conf65
1 files changed, 65 insertions, 0 deletions
diff --git a/contrib/init/dogecoind.conf b/contrib/init/dogecoind.conf
new file mode 100644
index 000000000..8faf8bd58
--- /dev/null
+++ b/contrib/init/dogecoind.conf
@@ -0,0 +1,65 @@
+description "Dogecoin Core Daemon"
+
+start on runlevel [2345]
+stop on starting rc RUNLEVEL=[016]
+
+env DOGECOIND_BIN="/usr/bin/dogecoind"
+env DOGECOIND_USER="dogecoin"
+env DOGECOIND_GROUP="dogecoin"
+env DOGECOIND_PIDDIR="/var/run/dogecoind"
+# upstart can't handle variables constructed with other variables
+env DOGECOIND_PIDFILE="/var/run/dogecoind/dogecoind.pid"
+env DOGECOIND_CONFIGFILE="/etc/dogecoin/dogecoin.conf"
+env DOGECOIND_DATADIR="/var/lib/dogecoind"
+
+expect fork
+
+respawn
+respawn limit 5 120
+kill timeout 60
+
+pre-start script
+ # this will catch non-existent config files
+ # dogecoind 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=' "$DOGECOIND_CONFIGFILE" ; then
+ echo "ERROR: You must set a secure rpcpassword to run dogecoind."
+ echo "The setting must appear in $DOGECOIND_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 \"Dogecoin Alert\"" \
+ echo
+ exit 1
+ fi
+
+ mkdir -p "$DOGECOIND_PIDDIR"
+ chmod 0755 "$DOGECOIND_PIDDIR"
+ chown $DOGECOIND_USER:$DOGECOIND_GROUP "$DOGECOIND_PIDDIR"
+ chown $DOGECOIND_USER:$DOGECOIND_GROUP "$DOGECOIND_CONFIGFILE"
+ chmod 0660 "$DOGECOIND_CONFIGFILE"
+end script
+
+exec start-stop-daemon \
+ --start \
+ --pidfile "$DOGECOIND_PIDFILE" \
+ --chuid $DOGECOIND_USER:$DOGECOIND_GROUP \
+ --exec "$DOGECOIND_BIN" \
+ -- \
+ -pid="$DOGECOIND_PIDFILE" \
+ -conf="$DOGECOIND_CONFIGFILE" \
+ -datadir="$DOGECOIND_DATADIR" \
+ -disablewallet \
+ -daemon
+