diff --git a/doc/rippled-example.cfg b/doc/rippled-example.cfg index c3678a9fc..f315e1964 100644 --- a/doc/rippled-example.cfg +++ b/doc/rippled-example.cfg @@ -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 diff --git a/doc/rippled.init b/doc/rippled.init index 79604a3fc..7aba5d9f2 100644 --- a/doc/rippled.init +++ b/doc/rippled.init @@ -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 @@ -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 "." ;; @@ -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