Skip to content

Commit

Permalink
Improvements to initscript and default configuration.
Browse files Browse the repository at this point in the history
* Added absolute paths to the [node_db] and [debug_logfile] stanzas in the config file.

* Changed some tabs into spaces for consistency.

* Added directory tree sanity checking to initscript.

Signed-off-by: The Doctor <drwho@virtadpt.net>
  • Loading branch information
virtadpt committed Dec 20, 2013
1 parent 3e2b5dc commit 21faf8e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
4 changes: 2 additions & 2 deletions doc/rippled-example.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -785,12 +785,12 @@ medium
# Note that HyperLevelDB is unavailable on Windows platforms
[node_db]
type=HyperLevelDB
path=db/hyperldb
path=/etc/ripple/db/hyperldb

# This needs to be an absolute directory reference, not a relative one.
# Modify this value as required.
[debug_logfile]
log/debug.log
/var/log/rippled/debug.log

[sntp_servers]
time.windows.com
Expand Down
25 changes: 19 additions & 6 deletions doc/rippled.init
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,22 @@ PIDFILE=/var/run/$NAME.pid
DAEMON=/usr/local/sbin/rippled
DAEMON_OPTS="--conf /etc/ripple/rippled.cfg"
NET_OPTS="--net $DAEMON_OPTS"
LOGDIR="/var/log/rippled"
DBDIR="/var/db/rippled/db/hyperldb"

export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"

# I wish it didn't come down to this, but this is the easiest way to ensure
# sanity of an install.
if [ ! -d $LOGDIR ]; then
mkdir -p $LOGDIR
chown $USER:$GROUP $LOGDIR
fi
if [ ! -d $DBDIR ]; then
mkdir -p $DBDIR
chown -R $USER:$GROUP $DBDIR
fi

case "$1" in
start)
echo -n "Starting daemon: "$NAME
Expand Down Expand Up @@ -50,11 +63,11 @@ case "$1" in
echo "Status of $NAME:"
echo -n "PID of $NAME: "
if [ -f "$PIDFILE" ]; then
cat $PIDFILE
$DAEMON $DAEMON_OPTS server_info
else
echo "$NAME not running."
fi
cat $PIDFILE
$DAEMON $DAEMON_OPTS server_info
else
echo "$NAME not running."
fi
echo "."
;;

Expand Down Expand Up @@ -93,7 +106,7 @@ case "$1" in

*)
echo "Usage: $0 {start|stop|restart|status|fetch|uptime|startconfig|"
echo " command|test}"
echo " command|test}"
exit 1
esac

Expand Down

0 comments on commit 21faf8e

Please sign in to comment.