Browse Source

make nilmdb-server startup a little nicer

tags/nilmdbuntu-1
Jim Paris 8 years ago
parent
commit
3ce08771a6
2 changed files with 13 additions and 4 deletions
  1. +12
    -3
      customize-inner.sh
  2. +1
    -1
      full-rebuild.sh

+ 12
- 3
customize-inner.sh View File

@@ -212,16 +212,25 @@ chown -R nilmdb:nilmdb /home/nilmdb/git

# Create the initial database and streams by running the standalone
# server as nilmdb, making the right nilmtool calls, and killing it.
sudo -i -u nilmdb nilmdb-server -a 127.0.0.1 -p 18646 &
sleep 1
sudo -i -u nilmdb nilmdb-server -a 127.0.0.1 -p 18646 -d /home/nilmdb/db &
SERVERPID=$!
trap "kill -9 $SERVERPID" 0
for i in $(seq 1 120) ; do
sleep 1
echo waiting for nilmdb to start $i
if nilmtool -u http://127.0.0.1:18646/ info ; then
break
fi
done
nilmtool -u http://127.0.0.1:18646/ destroy -R "/data/*" || true
nilmtool -u http://127.0.0.1:18646/ create /data/raw uint16_6
nilmtool -u http://127.0.0.1:18646/ create /data/sinefit float32_3
nilmtool -u http://127.0.0.1:18646/ create /data/prep-a float32_8
nilmtool -u http://127.0.0.1:18646/ create /data/prep-b float32_8
nilmtool -u http://127.0.0.1:18646/ create /data/prep-c float32_8
kill $!
kill $SERVERPID
wait
trap "" 0

# Put some default desktop shortcuts in place
mkdir -p /etc/skel/Desktop


+ 1
- 1
full-rebuild.sh View File

@@ -4,7 +4,7 @@
# passwords during execution
if [ $UID -ne 0 ] ; then
echo "Need to be root; trying sudo"
exec sudo $0 "$@"
exec sudo nice $0 "$@"
fi

. config || exit 0


Loading…
Cancel
Save