I created 3 files to start and stop the server, The last line will Auto Start the server on boot.
elsinorestart.sh with the below bash
#!/bin/bash
cd /usr/local/src/SB_Elsinore_Server
java -jar Elsinore.jar
elsinorestop.sh with the below bash
#!/bin/bash
# Grabs and kill a process from the pidlist that has the word myapp
pid=`ps aux | grep Elsinore | awk '{print $2}'`
kill -9 $pid
Elsinore with the below code and placed it in /etc/init.d/ folder
#!/bin/bash
### BEGIN INIT INFO
# Provides: Elsinore Server
# Required-Start: $local_fs $syslog $remote_fs dbus
# Required-Stop: $local_fs $syslog $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start transparentproxy
### END INIT INFO
case $1 in
start)
/bin/bash /usr/local/bin/elsinorestart.sh
;;
stop)
/bin/bash /usr/local/bin/elsinorestop.sh
;;
restart)
/bin/bash /usr/local/bin/elsinorestop.sh
/bin/bash /usr/local/bin/elsinorestart.sh
;;
esac
exit 0
Then did an update-rc.d Elsinore defaults
Hi all, sorry to go over dead ground - it would seem from the lack of dialogue that people either have this cracked or aren't needing to run the unit headless.
I've tried testing the script provided above (sudo /etc/init.d/Elsinore start) and get the message:
/bin/bash: /usr/local/bin/elsinorestart.sh: no such file or directory
I haven't been able to make this run and have checked that each of my files are letter perfect.
I've taken a flier and having read around have initialised the script :
sudo chmod 755 /etc/init.d/Elsinore
which gave me the next command prompt. following this I've tried the update-rc.d Elsinore defaults command
which has given me a truckload of permission denied messages (inserv : can not symlink, can not remove etc.)
Have I done something wrong?
Is there an issue with permissions on my pi?
Really appreciate any help you can give.
thanks to everyone so far, it is a credit to the feedback that you all have given so far which has meant I've been able to get this far (last time I did anything remotely electronics based was a radio shack crystal radio kit 30 years ago, and I messed that up!!!)
cheers,
james