Skip to content

Commit

Permalink
Rebrand and update init scripts for Namecoin.
Browse files Browse the repository at this point in the history
This is basically a s/bitcoin/namecoin/g (and various other variants in
capitalisation) for the init scripts in contrib/init.

This fixes namecoin/namecoin-core#113.
  • Loading branch information
domob1812 committed Jun 11, 2018
1 parent f0f67f1 commit 5a621b3
Show file tree
Hide file tree
Showing 12 changed files with 315 additions and 314 deletions.
12 changes: 6 additions & 6 deletions contrib/init/README.md
Original file line number Diff line number Diff line change
@@ -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: namecoind.service
Upstart: namecoind.conf
OpenRC: namecoind.openrc
namecoind.openrcconf
CentOS: namecoind.init
OS X: org.namecoin.namecoind.plist
```
have been made available to assist packagers in creating node packages here.

Expand Down
65 changes: 0 additions & 65 deletions contrib/init/bitcoind.conf

This file was deleted.

67 changes: 0 additions & 67 deletions contrib/init/bitcoind.init

This file was deleted.

92 changes: 0 additions & 92 deletions contrib/init/bitcoind.openrc

This file was deleted.

33 changes: 0 additions & 33 deletions contrib/init/bitcoind.openrcconf

This file was deleted.

65 changes: 65 additions & 0 deletions contrib/init/namecoind.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
description "Namecoin Core Daemon"

start on runlevel [2345]
stop on starting rc RUNLEVEL=[016]

env NAMECOIND_BIN="/usr/bin/namecoind"
env NAMECOIND_USER="namecoin"
env NAMECOIND_GROUP="namecoin"
env NAMECOIND_PIDDIR="/var/run/namecoind"
# upstart can't handle variables constructed with other variables
env NAMECOIND_PIDFILE="/var/run/namecoind/namecoind.pid"
env NAMECOIND_CONFIGFILE="/etc/namecoin/namecoin.conf"
env NAMECOIND_DATADIR="/var/lib/namecoind"

expect fork

respawn
respawn limit 5 120
kill timeout 60

pre-start script
# this will catch non-existent config files
# namecoind 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=' "$NAMECOIND_CONFIGFILE" ; then
echo "ERROR: You must set a secure rpcpassword to run namecoind."
echo "The setting must appear in $NAMECOIND_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 recommended that you also set alertnotify so you are "
echo "notified of problems:"
echo
echo "ie: alertnotify=echo %%s | mail -s \"Namecoin Alert\"" \
"admin@foo.com"
echo
exit 1
fi

mkdir -p "$NAMECOIND_PIDDIR"
chmod 0755 "$NAMECOIND_PIDDIR"
chown $NAMECOIND_USER:$NAMECOIND_GROUP "$NAMECOIND_PIDDIR"
chown $NAMECOIND_USER:$NAMECOIND_GROUP "$NAMECOIND_CONFIGFILE"
chmod 0660 "$NAMECOIND_CONFIGFILE"
end script

exec start-stop-daemon \
--start \
--pidfile "$NAMECOIND_PIDFILE" \
--chuid $NAMECOIND_USER:$NAMECOIND_GROUP \
--exec "$NAMECOIND_BIN" \
-- \
-pid="$NAMECOIND_PIDFILE" \
-conf="$NAMECOIND_CONFIGFILE" \
-datadir="$NAMECOIND_DATADIR" \
-disablewallet \
-daemon

Loading

0 comments on commit 5a621b3

Please sign in to comment.