Category Archives: bash

Bash Experts

Any BASH experts in here?

I have a very crude startup script made by using WEBMIN on my Raspberry Pi.  It starts up BLYNK

Now if I type the command line….

java -jar /var/blynk/server-0.10.2.jar -dataFolder /var/blynk &

That ampersand on the end will ensure my terminal program prompt comes back to me once the program is started up!!!

However, if I put that (and a change of directory which is necessary) into Webmin for a startup script…

It works ok – but the Raspberry Pi terminal comes up for login – but then starts this script – and stays in it – i.e. no more prompt - hitting Control C brings it back but of course the program has stopped.

Update: Wrapping in parentheses helps…. with that, one can get the prompt back by simply hitting ENTER and the program keeps running – but really, that’s not the answer. I don’t understand why this happens after the prompt first appears where all other services seem to be up and running before then. See comments…

My questions for script wizards are:

1. What do I need to change so that this will indeed run in the background like all the other items that Webmin has created

2. What can I change to add a STOP function to this?

# Provides: Blynk
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 5
# Description:

case "$1" in
    cd /var/blynk
    java -jar /var/blynk/server-0.10.2.jar -dataFolder /var/blynk &
    echo "Usage: $0 { start | stop }"
exit 0