start-stop-daemon and javaFX program

154 views Asked by At

this is driving me crazy, please could you help with the start-stop-daemon to start a javafx jar file, where I need to issue the following command to start it

sudo /opt/jdk1.8.0/bin/java -Djavafx.platform=eglfb -cp /opt/jdk1.8.0/jre/lib/jfxrt.jar:/home/pi/prayertime/JavaFXApplication4.jar javafxapplication4.JavaFXApplication4 &

and the start_stop_daemon script is as follows

#!/bin/sh
#
# init script for ship-it
#

### BEGIN INIT INFO
# Provides:          ship-it
# Required-Start:    $remote_fs $syslog $network
# Required-Stop:     $remote_fs $syslog $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: init script for the ship-it box
# Description:       We'll have to fill this out later...
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
NAME=prayertime
DAEMON=/home/pi/prayertime/JavaFXApplication4.jar
DAEMONARGS="javafxapplication4.JavaFXApplication4"
PIDFILE=/var/run/$NAME.pid
LOGFILE=/var/log/$NAME.log

. /lib/lsb/init-functions

test -f $DAEMON || exit 0

case "$1" in
    start)
        start-stop-daemon --start --background \
            --pidfile $PIDFILE --make-pidfile --startas /bin/bash \
            -- -c "exec sudo /opt/jdk1.8.0/bin/java -Djavafx.platform=eglfb -cp /opt/jdk1.8.0/jre/lib/jfxrt.jar: $DAEMON $DAEMONARGS > $LOGFILE 2>&1"
        log_end_msg $?
        ;;
0

There are 0 answers