s/bitcoin/dogecoin/ in init scripts (#1456)

This commit is contained in:
Ross Nicoll 2018-01-21 13:57:29 +00:00
parent a1fef56809
commit 5ce59f8706
11 changed files with 206 additions and 206 deletions

View file

@ -1,11 +1,11 @@
Sample configuration files for:
SystemD: bitcoind.service
Upstart: bitcoind.conf
OpenRC: bitcoind.openrc
bitcoind.openrcconf
CentOS: bitcoind.init
OS X: org.bitcoin.bitcoind.plist
SystemD: dogecoind.service
Upstart: dogecoind.conf
OpenRC: dogecoind.openrc
dogecoind.openrcconf
CentOS: dogecoind.init
OS X: org.dogecoin.dogecoind.plist
have been made available to assist packagers in creating node packages here.

View file

@ -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

View file

@ -1,67 +0,0 @@
#!/bin/bash
#
# bitcoind The bitcoin core server.
#
#
# chkconfig: 345 80 20
# description: bitcoind
# processname: bitcoind
#
# Source function library.
. /etc/init.d/functions
# you can override defaults in /etc/sysconfig/bitcoind, see below
if [ -f /etc/sysconfig/bitcoind ]; then
. /etc/sysconfig/bitcoind
fi
RETVAL=0
prog=bitcoind
# you can override the lockfile via BITCOIND_LOCKFILE in /etc/sysconfig/bitcoind
lockfile=${BITCOIND_LOCKFILE-/var/lock/subsys/bitcoind}
# bitcoind defaults to /usr/bin/bitcoind, override with BITCOIND_BIN
bitcoind=${BITCOIND_BIN-/usr/bin/bitcoind}
# bitcoind opts default to -disablewallet, override with BITCOIND_OPTS
bitcoind_opts=${BITCOIND_OPTS--disablewallet}
start() {
echo -n $"Starting $prog: "
daemon $DAEMONOPTS $bitcoind $bitcoind_opts
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $lockfile
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f $lockfile
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $prog
;;
restart)
stop
start
;;
*)
echo "Usage: service $prog {start|stop|status|restart}"
exit 1
;;
esac

View file

@ -1,33 +0,0 @@
# /etc/conf.d/bitcoind: config file for /etc/init.d/bitcoind
# Config file location
#BITCOIND_CONFIGFILE="/etc/bitcoin/bitcoin.conf"
# What directory to write pidfile to? (created and owned by $BITCOIND_USER)
#BITCOIND_PIDDIR="/var/run/bitcoind"
# What filename to give the pidfile
#BITCOIND_PIDFILE="${BITCOIND_PIDDIR}/bitcoind.pid"
# Where to write bitcoind data (be mindful that the blockchain is large)
#BITCOIND_DATADIR="/var/lib/bitcoind"
# User and group to own bitcoind process
#BITCOIND_USER="bitcoin"
#BITCOIND_GROUP="bitcoin"
# Path to bitcoind executable
#BITCOIND_BIN="/usr/bin/bitcoind"
# Nice value to run bitcoind under
#BITCOIND_NICE=0
# Additional options (avoid -conf and -datadir, use flags above)
BITCOIND_OPTS="-disablewallet"
# The timeout in seconds OpenRC will wait for bitcoind to terminate
# after a SIGTERM has been raised.
# Note that this will be mapped as argument to start-stop-daemon's
# '--retry' option, which means you can specify a retry schedule
# here. For more information see man 8 start-stop-daemon.
BITCOIND_SIGTERM_TIMEOUT=60

View file

@ -1,22 +0,0 @@
[Unit]
Description=Bitcoin's distributed currency daemon
After=network.target
[Service]
User=bitcoin
Group=bitcoin
Type=forking
PIDFile=/var/lib/bitcoind/bitcoind.pid
ExecStart=/usr/bin/bitcoind -daemon -pid=/var/lib/bitcoind/bitcoind.pid \
-conf=/etc/bitcoin/bitcoin.conf -datadir=/var/lib/bitcoind -disablewallet
Restart=always
PrivateTmp=true
TimeoutStopSec=60s
TimeoutStartSec=2s
StartLimitInterval=120s
StartLimitBurst=5
[Install]
WantedBy=multi-user.target

View file

@ -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\"" \
"admin@foo.com"
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

View file

@ -0,0 +1,67 @@
#!/bin/bash
#
# dogecoind The dogecoin core server.
#
#
# chkconfig: 345 80 20
# description: dogecoind
# processname: dogecoind
#
# Source function library.
. /etc/init.d/functions
# you can override defaults in /etc/sysconfig/dogecoind, see below
if [ -f /etc/sysconfig/dogecoind ]; then
. /etc/sysconfig/dogecoind
fi
RETVAL=0
prog=dogecoind
# you can override the lockfile via DOGECOIND_LOCKFILE in /etc/sysconfig/dogecoind
lockfile=${DOGECOIND_LOCKFILE-/var/lock/subsys/dogecoind}
# dogecoind defaults to /usr/bin/dogecoind, override with DOGECOIND_BIN
dogecoind=${DOGECOIND_BIN-/usr/bin/dogecoind}
# dogecoind opts default to -disablewallet, override with DOGECOIND_OPTS
dogecoind_opts=${DOGECOIND_OPTS--disablewallet}
start() {
echo -n $"Starting $prog: "
daemon $DAEMONOPTS $dogecoind $dogecoind_opts
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $lockfile
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f $lockfile
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $prog
;;
restart)
stop
start
;;
*)
echo "Usage: service $prog {start|stop|status|restart}"
exit 1
;;
esac

View file

@ -2,26 +2,26 @@
# backward compatibility for existing gentoo layout
#
if [ -d "/var/lib/bitcoin/.bitcoin" ]; then
BITCOIND_DEFAULT_DATADIR="/var/lib/bitcoin/.bitcoin"
if [ -d "/var/lib/dogecoin/.dogecoin" ]; then
BITCOIND_DEFAULT_DATADIR="/var/lib/dogecoin/.dogecoin"
else
BITCOIND_DEFAULT_DATADIR="/var/lib/bitcoind"
BITCOIND_DEFAULT_DATADIR="/var/lib/dogecoind"
fi
BITCOIND_CONFIGFILE=${BITCOIND_CONFIGFILE:-/etc/bitcoin/bitcoin.conf}
BITCOIND_PIDDIR=${BITCOIND_PIDDIR:-/var/run/bitcoind}
BITCOIND_PIDFILE=${BITCOIND_PIDFILE:-${BITCOIND_PIDDIR}/bitcoind.pid}
BITCOIND_CONFIGFILE=${BITCOIND_CONFIGFILE:-/etc/dogecoin/dogecoin.conf}
BITCOIND_PIDDIR=${BITCOIND_PIDDIR:-/var/run/dogecoind}
BITCOIND_PIDFILE=${BITCOIND_PIDFILE:-${BITCOIND_PIDDIR}/dogecoind.pid}
BITCOIND_DATADIR=${BITCOIND_DATADIR:-${BITCOIND_DEFAULT_DATADIR}}
BITCOIND_USER=${BITCOIND_USER:-${BITCOIN_USER:-bitcoin}}
BITCOIND_GROUP=${BITCOIND_GROUP:-bitcoin}
BITCOIND_BIN=${BITCOIND_BIN:-/usr/bin/bitcoind}
BITCOIND_USER=${BITCOIND_USER:-${BITCOIN_USER:-dogecoin}}
BITCOIND_GROUP=${BITCOIND_GROUP:-dogecoin}
BITCOIND_BIN=${BITCOIND_BIN:-/usr/bin/dogecoind}
BITCOIND_NICE=${BITCOIND_NICE:-${NICELEVEL:-0}}
BITCOIND_OPTS="${BITCOIND_OPTS:-${BITCOIN_OPTS}}"
name="Bitcoin Core Daemon"
description="Bitcoin cryptocurrency P2P network daemon"
command="/usr/bin/bitcoind"
command="/usr/bin/dogecoind"
command_args="-pid=\"${BITCOIND_PIDFILE}\" \
-conf=\"${BITCOIND_CONFIGFILE}\" \
-datadir=\"${BITCOIND_DATADIR}\" \
@ -71,7 +71,7 @@ checkconfig()
{
if ! grep -qs '^rpcpassword=' "${BITCOIND_CONFIGFILE}" ; then
eerror ""
eerror "ERROR: You must set a secure rpcpassword to run bitcoind."
eerror "ERROR: You must set a secure rpcpassword to run dogecoind."
eerror "The setting must appear in ${BITCOIND_CONFIGFILE}"
eerror ""
eerror "This password is security critical to securing wallets "

View file

@ -0,0 +1,33 @@
# /etc/conf.d/dogecoind: config file for /etc/init.d/dogecoind
# Config file location
#DOGECOIND_CONFIGFILE="/etc/dogecoin/dogecoin.conf"
# What directory to write pidfile to? (created and owned by $DOGECOIND_USER)
#DOGECOIND_PIDDIR="/var/run/dogecoind"
# What filename to give the pidfile
#DOGECOIND_PIDFILE="${DOGECOIND_PIDDIR}/dogecoind.pid"
# Where to write dogecoind data (be mindful that the blockchain is large)
#DOGECOIND_DATADIR="/var/lib/dogecoind"
# User and group to own dogecoind process
#DOGECOIND_USER="dogecoin"
#DOGECOIND_GROUP="dogecoin"
# Path to dogecoind executable
#DOGECOIND_BIN="/usr/bin/dogecoind"
# Nice value to run dogecoind under
#DOGECOIND_NICE=0
# Additional options (avoid -conf and -datadir, use flags above)
DOGECOIND_OPTS="-disablewallet"
# The timeout in seconds OpenRC will wait for dogecoind to terminate
# after a SIGTERM has been raised.
# Note that this will be mapped as argument to start-stop-daemon's
# '--retry' option, which means you can specify a retry schedule
# here. For more information see man 8 start-stop-daemon.
DOGECOIND_SIGTERM_TIMEOUT=60

View file

@ -0,0 +1,22 @@
[Unit]
Description=Dogecoin's distributed currency daemon
After=network.target
[Service]
User=dogecoin
Group=dogecoin
Type=forking
PIDFile=/var/lib/dogecoind/dogecoind.pid
ExecStart=/usr/bin/dogecoind -daemon -pid=/var/lib/dogecoind/dogecoind.pid \
-conf=/etc/dogecoin/dogecoin.conf -datadir=/var/lib/dogecoind -disablewallet
Restart=always
PrivateTmp=true
TimeoutStopSec=60s
TimeoutStartSec=2s
StartLimitInterval=120s
StartLimitBurst=5
[Install]
WantedBy=multi-user.target

View file

@ -3,10 +3,10 @@
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.bitcoin.bitcoind</string>
<string>org.dogecoin.dogecoind</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/bitcoind</string>
<string>/usr/local/bin/dogecoind</string>
<string>-daemon</string>
</array>
<key>RunAtLoad</key>