Couchpotato and headphones both no starting after resetting drobo 5n. below is the code for both.
#!/bin/sh
CouchPotato service
PATH=$PATH:/bin:/usr/bin:/sbin:/usr/sbin:/mnt/DroboFS/Shares/DroboApps/git/bin
. /etc/service.subr
prog_dir=dirname \
realpath $0``
name=“CouchPotato”
version=“2”
python=$DROBOAPPS_DIR/python2/bin/python
pidfile="${prog_dir}/var/couchpotato.pid"
logfile="${prog_dir}/data/logs/CouchPotato.log"
user=root
create_user() {
grep -q “^${user}” /etc/passwd 1> /dev/null 2>&1
if [ $? -ne 0 ]; then
adduser -S -H -h “${prog_dir}/data” -D -s /bin/false -G nobody “${user}” 1> /dev/null 2>&1
fi
}
start() {
chmod a+rw /dev/null /dev/full /dev/random /dev/urandom /dev/tty /dev/ptmx /dev/zero /dev/crypto 1> /dev/null 2>&1
create_user
chown -R ${user} “${prog_dir}” 1> /dev/null 2>&1
rm -f “${pidfile}” 1> /dev/null 2>&1
su ${user} -s /bin/sh -c “${python} ${prog_dir}/app/CouchPotato.py --data_dir ${prog_dir}/data --daemon --pid_file ${pidfile} 1>> ${logfile} 2>&1”
return 0
}
case “$1” in
start) start_service ;;
stop) stop_service ;;
restart) stop_service ; sleep 3 ; start_service ;;
status) status ;;
*) echo “Usage: $0 [start|stop|restart|status]” ; exit 1 ;;
esac
#!/bin/sh
Headphones service
PATH=$PATH:/bin:/usr/bin:/sbin:/usr/sbin:/mnt/DroboFS/Shares/DroboApps/git/bin
. /etc/service.subr
prog_dir=dirname \
realpath $0``
name=“Headphones”
version=“1”
python=$DROBOAPPS_DIR/python2/bin/python
pidfile="${prog_dir}/var/headphones.pid"
logfile="${prog_dir}/data/logs/headphones.log"
user=root
create_user() {
grep -q “^${user}” /etc/passwd 1> /dev/null 2>&1
if [ $? -ne 0 ]; then
adduser -S -H -h “${prog_dir}/data” -D -s /bin/false -G nobody “${user}” 1> /dev/null 2>&1
fi
}
start() {
chmod a+rw /dev/null /dev/full /dev/random /dev/urandom /dev/tty /dev/ptmx /dev/zero /dev/crypto 1> /dev/null 2>&1
create_user
chown -R ${user} “${prog_dir}” 1> /dev/null 2>&1
rm -f “${pidfile}” 1> /dev/null 2>&1
su ${user} -s /bin/sh -c “${python} ${prog_dir}/app/Headphones.py --datadir ${prog_dir}/data --daemon --pidfile ${pidfile} 1>> ${logfile} 2>&1”
return 0
}
case “$1” in
start) start_service ;;
stop) stop_service ;;
restart) stop_service ; sleep 3 ; start_service ;;
status) status ;;
*) echo “Usage: $0 [start|stop|restart|status]” ; exit 1 ;;
esac
Both worked fine until a restart of my 5N
Now get errrors for both
./service.sh: line 1: can’t create /tmp/DroboApps/couchpotato/name.txt: Permission denied
./service.sh: line 1: can’t create /tmp/DroboApps/couchpotato/version.txt: Permission denied
su: must be suid to work properly
::EDIT::
Okay still not working now ive reinstalled couchpotato but when i try and start the service i get following
./service.sh status
CouchPotato is enabled and stopped
./service.sh start
sh: can’t create /mnt/DroboFS/Shares/DroboApps/couchpotato/data/logs/CouchPotato.log: nonexistent directory