diff --git a/init/Makefile b/init/Makefile index 00ed95d0..df641329 100644 --- a/init/Makefile +++ b/init/Makefile @@ -38,8 +38,8 @@ as_root: ifneq ($(USER),root) $(error Must run as superuser!) endif - sed -i 's/pi/$(USR)/' rv.service - sed -i 's/pi/$(USR)/' run.sh + sed -i 's//$(USR)/' rv.service + sed -i 's//$(USR)/' run.sh make_dirs: if [ ! -d /var/netsender ] ; then \ diff --git a/init/run.sh b/init/run.sh index 22e69769..fba789a9 100755 --- a/init/run.sh +++ b/init/run.sh @@ -1,13 +1,13 @@ #!/bin/sh -e -# This script launches rv on a pi, intended to run at boot time. +# This script launches rv on a , intended to run at boot time. -RVPATH=/home/pi/go/src/bitbucket.org/ausocean/av/cmd/rv +RVPATH=/home//go/src/bitbucket.org/ausocean/av/cmd/rv echo Set kernel parameters: # kernel settings to improve performance on Raspberry Pi # tell Linux to fork optimistically sudo sysctl -w vm.overcommit_memory=1 -# minimize swapping, without disabling it completely +# minimize swapng, without disabling it completely sudo sysctl -w vm.swappiness=1 # the following required directories _should_ already exist @@ -28,13 +28,13 @@ sudo ip addr show | grep inet exec 2> /var/log/netsender/stream.log exec 1>&2 -# set env, working dir and run rv as pi user -HOME=/home/pi +# set env, working dir and run rv as user +HOME=/home/ GOPATH=$HOME/go RVPATH=$GOPATH/src/bitbucket.org/ausocean/av/cmd/rv PATH=$PATH:/usr/local/go/bin:$RVPATH cd $RVPATH -sudo -u pi HOME=$HOME GOPATH=$GOPATH PATH=$PATH ./rv +sudo -u HOME=$HOME GOPATH=$GOPATH PATH=$PATH ./rv if [ $? -eq 0 ] then echo "Successfully exited rv" diff --git a/init/rv.service b/init/rv.service index 019c4490..13fb3127 100644 --- a/init/rv.service +++ b/init/rv.service @@ -3,7 +3,7 @@ Description=Netsender Client for Media Collection and Forwarding [Service] Type=simple -ExecStart=/home/pi/go/src/bitbucket.org/ausocean/av/init/run.sh +ExecStart=/home//go/src/bitbucket.org/ausocean/av/init/run.sh Restart=on-failure [Install]