To make the process still working after you close the terminal you run the command, you have to put the process to work in background by putting an Ampersand &
at the end of the command.
For example:
java -jar /home/pi/Blynk/server-0.41.11.jar -dataFolder /home/pi/Blynk &
not just
java -jar /home/pi/Blynk/server-0.41.11.jar -dataFolder /home/pi/Blynk
To make the Blynk Server working after restarting the RPi, you need to put the command in /etc/rc.local
. You can use nano
text editor to do that.
pi@raspberrypi-02:~ $ sudo nano /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
# Add this line before exit 0
java -jar /home/pi/Blynk/server-0.41.11.jar -dataFolder /home/pi/Blynk &
exit 0
then press Ctrl-O
to Write-Out
or Save
. Finally Ctrl-X
to exit
.
Try to restart by
pi@raspberrypi-02:~ $ sudo shutdown -r now